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