LT old and new provided SEM_VALUE_MAX in semaphore.h, NPTL in local_lim.h
Make sure to get the same definitions, independently of the fact, that
semaphore.h is included or not.
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
/* glibc uses 16384 */
# define PTHREAD_THREADS_MAX 1024
# define TIMER_MAX 256
-# undef SEM_VALUE_MAX
+# ifdef __LINUXTHREADS_OLD__
+# undef SEM_VALUE_MAX
+# define SEM_VALUE_MAX ((int) ((~0u) >> 1))
+# endif
# undef PTHREAD_STACK_MIN
/* glibc uses at least 16364 */
# define PTHREAD_STACK_MIN 1024
#include <features.h>
#include <sys/types.h>
+#include <limits.h>
#ifdef __USE_XOPEN2K
# define __need_timespec
# include <time.h>
#define SEM_FAILED ((sem_t *) 0)
/* Maximum value the semaphore can have. */
+#ifndef SEM_VALUE_MAX
#define SEM_VALUE_MAX ((int) ((~0u) >> 1))
+#endif
__BEGIN_DECLS
#include <features.h>
#include <sys/types.h>
+#include <limits.h>
#ifdef __USE_XOPEN2K
# define __need_timespec
# include <time.h>
#define SEM_FAILED ((sem_t *) 0)
/* Maximum value the semaphore can have. */
+#ifndef SEM_VALUE_MAX
#define SEM_VALUE_MAX (2147483647)
+#endif
__BEGIN_DECLS