base64: Reference latest RFC.
[gnulib.git] / m4 / close.m4
1 # close.m4 serial 7
2 dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 AC_DEFUN([gl_FUNC_CLOSE],
8 [
9   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
10   m4_ifdef([gl_PREREQ_SYS_H_WINSOCK2], [
11     gl_PREREQ_SYS_H_WINSOCK2
12     if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then
13       dnl Even if the 'socket' module is not used here, another part of the
14       dnl application may use it and pass file descriptors that refer to
15       dnl sockets to the close() function. So enable the support for sockets.
16       REPLACE_CLOSE=1
17     fi
18   ])
19   dnl Replace close() for supporting the gnulib-defined fchdir() function,
20   dnl to keep fchdir's bookkeeping up-to-date.
21   m4_ifdef([gl_FUNC_FCHDIR], [
22     if test $REPLACE_CLOSE = 0; then
23       gl_TEST_FCHDIR
24       if test $HAVE_FCHDIR = 0; then
25         REPLACE_CLOSE=1
26       fi
27     fi
28   ])
29 ])