xref: /third_party/ltp/testcases/realtime/m4/check.m4 (revision f08c3bdf)
1f08c3bdfSopenharmony_ciAC_DEFUN([REALTIME_CHECK_PRIO_INHERIT],[
2f08c3bdfSopenharmony_ciAC_MSG_CHECKING([for PTHREAD_PRIO_INHERIT])
3f08c3bdfSopenharmony_ciAC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
4f08c3bdfSopenharmony_ci#include <pthread.h>]], [[int main(void) {
5f08c3bdfSopenharmony_ci	pthread_mutexattr_t attr;
6f08c3bdfSopenharmony_ci	return pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT);
7f08c3bdfSopenharmony_ci}]])],[has_priority_inherit="yes"],[])
8f08c3bdfSopenharmony_ciif test "x$has_priority_inherit" = "xyes" ; then
9f08c3bdfSopenharmony_ci	AC_DEFINE(HAS_PRIORITY_INHERIT,1,[Define to 1 if you have PTHREAD_PRIO_INHERIT])
10f08c3bdfSopenharmony_ci	AC_MSG_RESULT(yes)
11f08c3bdfSopenharmony_cielse
12f08c3bdfSopenharmony_ci	AC_MSG_RESULT(no)
13f08c3bdfSopenharmony_cifi
14f08c3bdfSopenharmony_ci])
15