1AC_DEFUN([REALTIME_CHECK_PRIO_INHERIT],[
2AC_MSG_CHECKING([for PTHREAD_PRIO_INHERIT])
3AC_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"],[])
11if 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)
14else
15	AC_MSG_RESULT(no)
16fi
17])
18
19AC_DEFUN([REALTIME_CHECK_ROBUST_APIS],[
20AC_MSG_CHECKING([for pthread_mutexattr_*robust* APIs])
21AC_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"])
29if 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)
32else
33	AC_MSG_RESULT(no)
34fi
35])
36
37AC_DEFUN([REALTIME_CHECK_ROBUST_APIS],[
38AC_MSG_CHECKING([for pthread_mutexattr_*robust* APIs])
39AC_TRY_COMPILE([
40#ifndef _GNU_SOURCE
41#define _GNU_SOURCE
42#endif
43#include <pthread.h>],[int main(void) {
44	pthread_mutexattr_t attr;
45	return pthread_mutexattr_setrobust_np(&attr, 0);
46}],[has_robust="yes"])
47if test "x$has_robust" = "xyes" ; then
48	AC_DEFINE(HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS,1,[Define to 1 if you have pthread_mutexattr_*robust* APIs])
49	AC_MSG_RESULT(yes)
50else
51	AC_MSG_RESULT(no)
52fi
53])
54