Imported Upstream version 20091031
[ltp-debian.git] / testcases / realtime / m4 / check.m4
blobe54431ff05165e873abc5d73f4ed43f0539008e6
1 AC_DEFUN([REALTIME_CHECK_PRIO_INHERIT],[
2 AC_MSG_CHECKING([Checking for PTHREAD_PRIO_INHERIT])
3 AC_TRY_COMPILE([
4 #ifndef _GNU_SOURCE
5 #define _GNU_SOURCE
6 #endif
7 #include <pthread.h>],[int main(void) {
8         pthread_mutexattr_t attr;
9         return pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT);
10 }],[has_priority_inherit="yes"],[])
11 if test "x$has_priority_inherit" = "xyes" ; then
12         AC_DEFINE(HAS_PRIORITY_INHERIT,1,[Define to 1 if you have PTHREAD_PRIO_INHERIT])
13         AC_MSG_RESULT(yes)
14 else
15         AC_MSG_RESULT(no)
19 AC_DEFUN([REALTIME_CHECK_ROBUST_APIS],[
20 AC_MSG_CHECKING([Checking for pthread_mutexattr_*robust* APIs])
21 AC_TRY_COMPILE([
22 #ifndef _GNU_SOURCE
23 #define _GNU_SOURCE
24 #endif
25 #include <pthread.h>],[int main(void) {
26         pthread_mutexattr_t attr;
27         return pthread_mutexattr_setrobust_np(&attr, 0);
28 }],[has_robust="yes"])
29 if test "x$has_robust" = "xyes" ; then
30         AC_DEFINE(HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS,1,[Define to 1 if you have pthread_mutexattr_*robust* APIs])
31         AC_MSG_RESULT(yes)
32 else
33         AC_MSG_RESULT(no)