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 Thu, Apr 12, 2012 at 10:04 AM, Mike Frysinger <vapier@gentoo.org> wrote:
> 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. ...

Hi Mike,

Thanks a lot.
Yes, there is no limit for SEM_NSEM_MAX.


> -mike



-- 
Regards,
Neil


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