| 1 |
# flock.m4 |
| 2 |
# serial 4 |
| 3 |
dnl Copyright (C) 2008-2024 Free Software Foundation, Inc. |
| 4 |
dnl This file is free software; the Free Software Foundation |
| 5 |
dnl gives unlimited permission to copy and/or distribute it, |
| 6 |
dnl with or without modifications, as long as this notice is preserved. |
| 7 |
dnl This file is offered as-is, without any warranty. |
| 8 |
|
| 9 |
AC_DEFUN([gl_FUNC_FLOCK], |
| 10 |
[ |
| 11 |
AC_REQUIRE([gl_SYS_FILE_H_DEFAULTS]) |
| 12 |
AC_CHECK_FUNCS_ONCE([flock]) |
| 13 |
if test $ac_cv_func_flock = no; then |
| 14 |
HAVE_FLOCK=0 |
| 15 |
fi |
| 16 |
]) |
| 17 |
|
| 18 |
dnl Prerequisites of lib/flock.c. |
| 19 |
AC_DEFUN([gl_PREREQ_FLOCK], |
| 20 |
[ |
| 21 |
AC_CHECK_FUNCS_ONCE([fcntl]) |
| 22 |
AC_CHECK_HEADERS_ONCE([unistd.h]) |
| 23 |
|
| 24 |
dnl Do we have a POSIX fcntl lock implementation? |
| 25 |
AC_CHECK_MEMBERS([struct flock.l_type],[],[],[[#include <fcntl.h>]]) |
| 26 |
]) |