semaphore.h: Add SEM_VALUE_MAX.

It's specified in POSIX, and FreeBSD puts it in this file.

Distinguish it from _POSIX_SEM_VALUE_MAX (which is really a
"minimum value this can have" as specified in POSIX.)
This commit is contained in:
Augustin Cavalier
2026-01-06 19:40:23 -05:00
parent ca5c5d531e
commit d763a3829a
4 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -679,7 +679,7 @@ _user_realtime_sem_open(const char* userName, int openFlagsOrShared,
if (context == NULL)
return B_NO_MEMORY;
if (semCount > MAX_POSIX_SEM_VALUE)
if (semCount > SEM_VALUE_MAX)
return B_BAD_VALUE;
// userSem must always be given
+2 -1
View File
@@ -8,6 +8,7 @@
#include <errno.h>
#include <limits.h>
#include <semaphore.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -96,7 +97,7 @@ __sysconf(int name)
// unlimited, instead of _POSIX_SEM_NSEMS_MAX
return -1;
case _SC_SEM_VALUE_MAX:
return _POSIX_SEM_VALUE_MAX;
return SEM_VALUE_MAX;
case _SC_IOV_MAX:
return IOV_MAX;
case _SC_NPROCESSORS_CONF: