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.
8 AC_DEFUN([gl_FUNC_FLOCK],
10 AC_REQUIRE([gl_SYS_FILE_H_DEFAULTS])
11 AC_CHECK_FUNCS_ONCE([flock])
12 if test $ac_cv_func_flock = no; then
17 dnl Prerequisites of lib/flock.c.
18 AC_DEFUN([gl_PREREQ_FLOCK],
20 AC_CHECK_FUNCS_ONCE([fcntl])
21 AC_CHECK_HEADERS_ONCE([unistd.h])
23 dnl Do we have a POSIX fcntl lock implementation?
24 AC_CHECK_MEMBERS([struct flock.l_type],[],[],[[#include <fcntl.h>]])