tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pthread library related



Hi Kamil,

   _SC_SEM_NSEMS_MAX is not the same with SEM_VALUE_MAX.
The first one is used to limit the number of sems for a process, while
the second is used to set the initial value for a semaphore.

2016-05-26 16:25 GMT-07:00 Kamil Rytarowski <n54%gmx.com@localhost>:

>
>
> On 27.05.2016 00:02, Christos Zoulas wrote:
> > 5. _SC_SEM_NSEMS_MAX, although that's not the real limit, good enough.
>
> Is it the same (indirectly) SEM_VALUE_MAX?
>
> #define SEM_VALUE_MAX   (~0U)
>
> It's located in <sys/semaphore.h>.
>
> I think we should go for LONG_MAX:
> 1. We will be able to return it via sysconf(3)
> 2. It's still large enough
> 3. Change SEM_VALUE_MAX to LONG_MAX to retain the same corresponding size.
>
> Also we perhaps should add a dynamic value of SEM_VALUE_MAX for
> sysconf(3) and maybe another value for the longest valid path name size
> (lately it was around 15 characters).
>


Home | Main Index | Thread Index | Old Index