Debian Codegraph @

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