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>
14 #include <sys/types.h>
15 #include <sys/param.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>
33 #include <sys/types.h>
34 #include <sys/param.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])