*** empty log message ***
[arla.git] / cf / bsd-func-lockstatus.m4
blobb165f48d818eda644fc28d8a0b683a48455eb1dd
1 dnl
2 dnl $Id$
3 dnl
5 AC_DEFUN([AC_BSD_FUNC_LOCKSTATUS], [
6 AC_CHECK_KERNEL_FUNCS(lockstatus)
7 if test "$ac_cv_kernel_func_lockstatus" = "yes"; then
8 AC_CACHE_CHECK(if lockstatus takes two arguments,
9 ac_cv_func_lockstatus_two_args,
10 AC_TRY_COMPILE_KERNEL([
11 #ifdef HAVE_SYS_CDEFS_H
12 #include <sys/cdefs.h>
13 #endif
14 #include <sys/types.h>
15 #include <sys/param.h>
16 #include <sys/time.h>
17 #include <sys/proc.h>
18 #include <sys/lock.h>
19 ], [lockstatus(NULL, NULL)],
20 ac_cv_func_lockstatus_two_args=yes,
21 ac_cv_func_lockstatus_two_args=no))
22 if test "$ac_cv_func_lockstatus_two_args" = yes; then
23         AC_DEFINE(HAVE_TWO_ARGUMENT_LOCKSTATUS, 1,
24         [define if lockstatus takes two arguments])
27 AC_CACHE_CHECK(if lockstatus takes one argument,
28 ac_cv_func_lockstatus_one_args,
29 AC_TRY_COMPILE_KERNEL([
30 #ifdef HAVE_SYS_CDEFS_H
31 #include <sys/cdefs.h>
32 #endif
33 #include <sys/types.h>
34 #include <sys/param.h>
35 #include <sys/proc.h>
36 #include <sys/lock.h>
37 ], [lockstatus(NULL)],
38 ac_cv_func_lockstatus_one_args=yes,
39 ac_cv_func_lockstatus_one_args=no))
40 if test "$ac_cv_func_lockstatus_one_args" = yes; then
41         AC_DEFINE(HAVE_ONE_ARGUMENT_LOCKSTATUS, 1,
42         [define if lockstatus takes one argument])
45 if test "$ac_cv_func_lockstatus_two_args" = "no" -a "$ac_cv_func_lockstatus_one_args" = "no"; then
46         AC_MSG_ERROR([unable to figure out how many args lockstatus takes])