printf oob regression test
[libc-test] / src / api / pthread.c
index 5be34c7..db772bb 100644 (file)
@@ -31,14 +31,19 @@ C(PTHREAD_MUTEX_RECURSIVE)
 C(PTHREAD_MUTEX_ROBUST)
 C(PTHREAD_MUTEX_STALLED)
 C(PTHREAD_ONCE_INIT)
+#if defined(POSIX_THREAD_ROBUST_PRIO_INHERIT) || defined(POSIX_THREAD_PRIO_INHERIT)
 C(PTHREAD_PRIO_INHERIT)
+#endif
+#if defined(POSIX_THREAD_ROBUST_PRIO_INHERIT) || defined(POSIX_THREAD_PRIO_INHERIT) \
+ || defined(POSIX_THREAD_ROBUST_PRIO_PROTECT) || defined(POSIX_THREAD_PRIO_PROTECT)
 C(PTHREAD_PRIO_NONE)
-#ifdef X_RPP_TPP
+#endif
+#if defined(POSIX_THREAD_ROBUST_PRIO_PROTECT) || defined(POSIX_THREAD_PRIO_PROTECT)
 C(PTHREAD_PRIO_PROTECT)
 #endif
 C(PTHREAD_PROCESS_SHARED)
 C(PTHREAD_PROCESS_PRIVATE)
-#ifdef X_TPS
+#ifdef POSIX_THREAD_PRIORITY_SCHEDULING
 C(PTHREAD_EXPLICIT_SCHED)
 C(PTHREAD_INHERIT_SCHED)
 C(PTHREAD_SCOPE_PROCESS)
@@ -68,8 +73,12 @@ C(PTHREAD_SCOPE_SYSTEM)
 {int(*p)(pthread_barrierattr_t*) = pthread_barrierattr_init;}
 {int(*p)(pthread_barrierattr_t*,int) = pthread_barrierattr_setpshared;}
 {int(*p)(pthread_t) = pthread_cancel;}
+#ifndef pthread_cleanup_pop
 {void(*p)(int) = pthread_cleanup_pop;}
+#endif
+#ifndef pthread_cleanup_push
 {void(*p)(void(*)(void*),void*) = pthread_cleanup_push;}
+#endif
 {int(*p)(pthread_cond_t*) = pthread_cond_broadcast;}
 {int(*p)(pthread_cond_t*) = pthread_cond_destroy;}
 {int(*p)(pthread_cond_t*restrict,const pthread_condattr_t*restrict) = pthread_cond_init;}
@@ -97,12 +106,15 @@ C(PTHREAD_SCOPE_SYSTEM)
 {int(*p)(pthread_mutex_t*) = pthread_mutex_trylock;}
 {int(*p)(pthread_mutex_t*) = pthread_mutex_unlock;}
 {int(*p)(pthread_mutexattr_t*) = pthread_mutexattr_destroy;}
+#if defined(POSIX_THREAD_ROBUST_PRIO_INHERIT) || defined(POSIX_THREAD_PRIO_INHERIT) \
+ || defined(POSIX_THREAD_ROBUST_PRIO_PROTECT) || defined(POSIX_THREAD_PRIO_PROTECT)
 {int(*p)(const pthread_mutexattr_t*restrict,int*restrict) = pthread_mutexattr_getprotocol;}
+{int(*p)(pthread_mutexattr_t*,int) = pthread_mutexattr_setprotocol;}
+#endif
 {int(*p)(const pthread_mutexattr_t*restrict,int*restrict) = pthread_mutexattr_getpshared;}
 {int(*p)(const pthread_mutexattr_t*restrict,int*restrict) = pthread_mutexattr_getrobust;}
 {int(*p)(const pthread_mutexattr_t*restrict,int*restrict) = pthread_mutexattr_gettype;}
 {int(*p)(pthread_mutexattr_t*) = pthread_mutexattr_init;}
-{int(*p)(pthread_mutexattr_t*,int) = pthread_mutexattr_setprotocol;}
 {int(*p)(pthread_mutexattr_t*,int) = pthread_mutexattr_setpshared;}
 {int(*p)(pthread_mutexattr_t*,int) = pthread_mutexattr_setrobust;}
 {int(*p)(pthread_mutexattr_t*,int) = pthread_mutexattr_settype;}
@@ -121,6 +133,10 @@ C(PTHREAD_SCOPE_SYSTEM)
 {pthread_t(*p)(void) = pthread_self;}
 {int(*p)(int,int*) = pthread_setcancelstate;}
 {int(*p)(int,int*) = pthread_setcanceltype;}
+#if defined _XOPEN_SOURCE && defined OBSOLETE
+{int(*p)(void) = pthread_getconcurrency;}
+{int(*p)(int) = pthread_setconcurrency;}
+#endif
 {int(*p)(pthread_t,int) = pthread_setschedprio;}
 {int(*p)(pthread_key_t,const void*) = pthread_setspecific;}
 {int(*p)(pthread_spinlock_t*) = pthread_spin_destroy;}
@@ -129,15 +145,13 @@ C(PTHREAD_SCOPE_SYSTEM)
 {int(*p)(pthread_spinlock_t*) = pthread_spin_trylock;}
 {int(*p)(pthread_spinlock_t*) = pthread_spin_unlock;}
 {void(*p)(void) = pthread_testcancel;}
-
-#ifdef X_RPP_TPP
+#if defined(POSIX_THREAD_ROBUST_PRIO_PROTECT) || defined(POSIX_THREAD_PRIO_PROTECT)
 {int(*p)(const pthread_mutex_t*restrict,int*restrict) = pthread_mutex_getprioceiling;}
 {int(*p)(pthread_mutex_t*restrict,int,int*restrict) = pthread_mutex_setprioceiling;}
 {int(*p)(const pthread_mutexattr_t*restrict,int*restrict) = pthread_mutexattr_getprioceiling;}
 {int(*p)(pthread_mutexattr_t*,int) = pthread_mutexattr_setprioceiling;}
 #endif
-
-#ifdef X_TPS
+#ifdef POSIX_THREAD_PRIORITY_SCHEDULING
 {int(*p)(const pthread_attr_t*restrict,int*restrict) = pthread_attr_getinheritsched;}
 {int(*p)(const pthread_attr_t*restrict,int*restrict) = pthread_attr_getschedpolicy;}
 {int(*p)(const pthread_attr_t*restrict,int*restrict) = pthread_attr_getscope;}