invalid argument on sysconf (_SC_AIO*)

Joel Sherrill joel.sherrill at OARcorp.com
Fri Feb 11 14:41:31 UTC 2011


On 02/10/2011 08:20 PM, Alin Rus wrote:
> Hello,
>
> I'm trying to get the values of a few POSIX constants using sysconf ()
> (_SC_AIO* ). It always returns -1 and sets the errno to 22 (invalid
> argument).
>
This one is easy.  cpukit/posix/src/sysconf.c only has the
bare minimum of _SC_ values supported.  Mostly for things
required by gcc, etc. and POSIX maximum values that are
user configurable.


> /opt/rtems-4.11/i386-rtems4.11/include/sys$ grep AIO* unistd.h
> #define _SC_AIO_LISTIO_MAX               34
> #define _SC_AIO_MAX                      35
> #define _SC_AIO_PRIO_DELTA_MAX           36
>
The proper thing to do here is add the above to the sysconf.c
file.

> /opt/rtems-4.11/i386-rtems4.11/include$ grep AIO* limits.h
> #define _POSIX_AIO_LISTIO_MAX   2
> #define _POSIX_AIO_MAX          1
> #define AIO_LISTIO_MAX          2
> #define AIO_MAX                 1
> #define AIO_PRIO_DELTA_MAX      0
>
>
> Any thoughts on this?
>
What are these supposed to mean?  Should these be
user configurable items?
> Also, on a related subject, how would one redefine these values in RTEMS
> without getting any compiler warnings? The values are way to low.
> Would the following approach be acceptable? Or is there a better way to
> achieve this?
>
Safe, minimal defaults in newilb's version of the file.  Then
possibly allow the limits to be raised by the user.
> -- file: confdefs.h --
>
> #ifndef RTEMS_AIO_{...}
>   #define RTEMS_AIO_{} AIO_{}
> #endif
>
> Regards,
>
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-users


-- 
Joel Sherrill, Ph.D.             Director of Research&  Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
    Support Available             (256) 722-9985





More information about the users mailing list