This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to define SEM_NSEMS_MAX?


On Wednesday 11 April 2012 21:47:34 Neil wrote:
> When I call
> max = sysconf(_SC_SEM_NSEMS_MAX);
> it returns -1
> 
> then I check the glibc code in file sysdeps/posix/sysconf.c:
> ------------------------------------------------
>     case _SC_SEM_NSEMS_MAX:
> #ifdef  SEM_NSEMS_MAX
>       return SEM_NSEMS_MAX;
> #else
>       return -1;
> #endif
> ------------------------------------------------
> 
> I grep the source code tree that SEM_NSEMS_MAX is not defined.
> So where can I define the SEM_NSEMS_MAX? Should it be defined in glibc
> source code tree or some configuration file else?

returning -1 is correct behavior.  please consult the POSIX spec:
	http://pubs.opengroup.org/onlinepubs/9699919799/functions/sysconf.html

RETURN VALUE

... If the variable corresponding to name is described in <limits.h> as a 
maximum or minimum value and the variable has no limit, sysconf() shall return 
-1 without changing the value of errno. ...
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]