Debian Codegraph @

tools/gnulib/m4/close.m4

raw
1 # close.m4
2 # serial 10
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
8 AC_DEFUN_ONCE([gl_FUNC_CLOSE],
9 [
10 AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
11 m4_ifdef([gl_MSVC_INVAL], [
12 AC_REQUIRE([gl_MSVC_INVAL])
13 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
14 REPLACE_CLOSE=1
15 fi
16 ])
17 m4_ifdef([gl_PREREQ_SYS_H_WINSOCK2], [
18 gl_PREREQ_SYS_H_WINSOCK2
19 if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then
20 dnl Even if the 'socket' module is not used here, another part of the
21 dnl application may use it and pass file descriptors that refer to
22 dnl sockets to the close() function. So enable the support for sockets.
23 REPLACE_CLOSE=1
24 fi
25 ])
26 dnl Replace close() for supporting the gnulib-defined fchdir() function,
27 dnl to keep fchdir's bookkeeping up-to-date.
28 m4_ifdef([gl_FUNC_FCHDIR], [
29 if test $REPLACE_CLOSE = 0; then
30 gl_TEST_FCHDIR
31 if test $HAVE_FCHDIR = 0; then
32 REPLACE_CLOSE=1
33 fi
34 fi
35 ])
36 ])