Blame m4/unistd_h.m4

Packit Service 4684c1
# unistd_h.m4 serial 78
Packit Service 4684c1
dnl Copyright (C) 2006-2020 Free Software Foundation, Inc.
Packit Service 4684c1
dnl This file is free software; the Free Software Foundation
Packit Service 4684c1
dnl gives unlimited permission to copy and/or distribute it,
Packit Service 4684c1
dnl with or without modifications, as long as this notice is preserved.
Packit Service 4684c1
Packit Service 4684c1
dnl Written by Simon Josefsson, Bruno Haible.
Packit Service 4684c1
Packit Service 4684c1
AC_DEFUN([gl_UNISTD_H],
Packit Service 4684c1
[
Packit Service 4684c1
  dnl Use AC_REQUIRE here, so that the default behavior below is expanded
Packit Service 4684c1
  dnl once only, before all statements that occur in other macros.
Packit Service 4684c1
  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
Packit Service 4684c1
Packit Service 4684c1
  gl_CHECK_NEXT_HEADERS([unistd.h])
Packit Service 4684c1
  if test $ac_cv_header_unistd_h = yes; then
Packit Service 4684c1
    HAVE_UNISTD_H=1
Packit Service 4684c1
  else
Packit Service 4684c1
    HAVE_UNISTD_H=0
Packit Service 4684c1
  fi
Packit Service 4684c1
  AC_SUBST([HAVE_UNISTD_H])
Packit Service 4684c1
Packit Service 4684c1
  dnl Ensure the type pid_t gets defined.
Packit Service 4684c1
  AC_REQUIRE([AC_TYPE_PID_T])
Packit Service 4684c1
Packit Service 4684c1
  dnl Determine WINDOWS_64_BIT_OFF_T.
Packit Service 4684c1
  AC_REQUIRE([gl_TYPE_OFF_T])
Packit Service 4684c1
Packit Service 4684c1
  dnl Check for declarations of anything we want to poison if the
Packit Service 4684c1
  dnl corresponding gnulib module is not in use.
Packit Service 4684c1
  gl_WARN_ON_USE_PREPARE([[
Packit Service 4684c1
#if HAVE_UNISTD_H
Packit Service 4684c1
# include <unistd.h>
Packit Service 4684c1
#endif
Packit Service 4684c1
/* Some systems declare various items in the wrong headers.  */
Packit Service 4684c1
#if !(defined __GLIBC__ && !defined __UCLIBC__)
Packit Service 4684c1
# include <fcntl.h>
Packit Service 4684c1
# include <stdio.h>
Packit Service 4684c1
# include <stdlib.h>
Packit Service 4684c1
# if defined _WIN32 && ! defined __CYGWIN__
Packit Service 4684c1
#  include <io.h>
Packit Service 4684c1
# endif
Packit Service 4684c1
#endif
Packit Service 4684c1
    ]], [access chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir
Packit Service 4684c1
    fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize
Packit Service 4684c1
    getentropy getgroups gethostname getlogin getlogin_r getpagesize getpass
Packit Service 4684c1
    getrandom getusershell setusershell endusershell
Packit Service 4684c1
    group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite
Packit Service 4684c1
    readlink readlinkat rmdir sethostname sleep symlink symlinkat
Packit Service 4684c1
    truncate ttyname_r unlink unlinkat usleep])
Packit Service 4684c1
Packit Service 4684c1
  AC_REQUIRE([AC_C_RESTRICT])
Packit Service 4684c1
])
Packit Service 4684c1
Packit Service 4684c1
AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
Packit Service 4684c1
[
Packit Service 4684c1
  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
Packit Service 4684c1
  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
Packit Service 4684c1
  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
Packit Service 4684c1
  dnl Define it also as a C macro, for the benefit of the unit tests.
Packit Service 4684c1
  gl_MODULE_INDICATOR_FOR_TESTS([$1])
Packit Service 4684c1
])
Packit Service 4684c1
Packit Service 4684c1
AC_DEFUN([gl_UNISTD_H_DEFAULTS],
Packit Service 4684c1
[
Packit Service 4684c1
  GNULIB_ACCESS=0;               AC_SUBST([GNULIB_ACCESS])
Packit Service 4684c1
  GNULIB_CHDIR=0;                AC_SUBST([GNULIB_CHDIR])
Packit Service 4684c1
  GNULIB_CHOWN=0;                AC_SUBST([GNULIB_CHOWN])
Packit Service 4684c1
  GNULIB_CLOSE=0;                AC_SUBST([GNULIB_CLOSE])
Packit Service 4684c1
  GNULIB_COPY_FILE_RANGE=0;      AC_SUBST([GNULIB_COPY_FILE_RANGE])
Packit Service 4684c1
  GNULIB_DUP=0;                  AC_SUBST([GNULIB_DUP])
Packit Service 4684c1
  GNULIB_DUP2=0;                 AC_SUBST([GNULIB_DUP2])
Packit Service 4684c1
  GNULIB_DUP3=0;                 AC_SUBST([GNULIB_DUP3])
Packit Service 4684c1
  GNULIB_ENVIRON=0;              AC_SUBST([GNULIB_ENVIRON])
Packit Service 4684c1
  GNULIB_EUIDACCESS=0;           AC_SUBST([GNULIB_EUIDACCESS])
Packit Service 4684c1
  GNULIB_FACCESSAT=0;            AC_SUBST([GNULIB_FACCESSAT])
Packit Service 4684c1
  GNULIB_FCHDIR=0;               AC_SUBST([GNULIB_FCHDIR])
Packit Service 4684c1
  GNULIB_FCHOWNAT=0;             AC_SUBST([GNULIB_FCHOWNAT])
Packit Service 4684c1
  GNULIB_FDATASYNC=0;            AC_SUBST([GNULIB_FDATASYNC])
Packit Service 4684c1
  GNULIB_FSYNC=0;                AC_SUBST([GNULIB_FSYNC])
Packit Service 4684c1
  GNULIB_FTRUNCATE=0;            AC_SUBST([GNULIB_FTRUNCATE])
Packit Service 4684c1
  GNULIB_GETCWD=0;               AC_SUBST([GNULIB_GETCWD])
Packit Service 4684c1
  GNULIB_GETDOMAINNAME=0;        AC_SUBST([GNULIB_GETDOMAINNAME])
Packit Service 4684c1
  GNULIB_GETDTABLESIZE=0;        AC_SUBST([GNULIB_GETDTABLESIZE])
Packit Service 4684c1
  GNULIB_GETENTROPY=0;           AC_SUBST([GNULIB_GETENTROPY])
Packit Service 4684c1
  GNULIB_GETGROUPS=0;            AC_SUBST([GNULIB_GETGROUPS])
Packit Service 4684c1
  GNULIB_GETHOSTNAME=0;          AC_SUBST([GNULIB_GETHOSTNAME])
Packit Service 4684c1
  GNULIB_GETLOGIN=0;             AC_SUBST([GNULIB_GETLOGIN])
Packit Service 4684c1
  GNULIB_GETLOGIN_R=0;           AC_SUBST([GNULIB_GETLOGIN_R])
Packit Service 4684c1
  GNULIB_GETOPT_POSIX=0;         AC_SUBST([GNULIB_GETOPT_POSIX])
Packit Service 4684c1
  GNULIB_GETPAGESIZE=0;          AC_SUBST([GNULIB_GETPAGESIZE])
Packit Service 4684c1
  GNULIB_GETPASS=0;              AC_SUBST([GNULIB_GETPASS])
Packit Service 4684c1
  GNULIB_GETRANDOM=0;            AC_SUBST([GNULIB_GETRANDOM])
Packit Service 4684c1
  GNULIB_GETUSERSHELL=0;         AC_SUBST([GNULIB_GETUSERSHELL])
Packit Service 4684c1
  GNULIB_GROUP_MEMBER=0;         AC_SUBST([GNULIB_GROUP_MEMBER])
Packit Service 4684c1
  GNULIB_ISATTY=0;               AC_SUBST([GNULIB_ISATTY])
Packit Service 4684c1
  GNULIB_LCHOWN=0;               AC_SUBST([GNULIB_LCHOWN])
Packit Service 4684c1
  GNULIB_LINK=0;                 AC_SUBST([GNULIB_LINK])
Packit Service 4684c1
  GNULIB_LINKAT=0;               AC_SUBST([GNULIB_LINKAT])
Packit Service 4684c1
  GNULIB_LSEEK=0;                AC_SUBST([GNULIB_LSEEK])
Packit Service 4684c1
  GNULIB_PIPE=0;                 AC_SUBST([GNULIB_PIPE])
Packit Service 4684c1
  GNULIB_PIPE2=0;                AC_SUBST([GNULIB_PIPE2])
Packit Service 4684c1
  GNULIB_PREAD=0;                AC_SUBST([GNULIB_PREAD])
Packit Service 4684c1
  GNULIB_PWRITE=0;               AC_SUBST([GNULIB_PWRITE])
Packit Service 4684c1
  GNULIB_READ=0;                 AC_SUBST([GNULIB_READ])
Packit Service 4684c1
  GNULIB_READLINK=0;             AC_SUBST([GNULIB_READLINK])
Packit Service 4684c1
  GNULIB_READLINKAT=0;           AC_SUBST([GNULIB_READLINKAT])
Packit Service 4684c1
  GNULIB_RMDIR=0;                AC_SUBST([GNULIB_RMDIR])
Packit Service 4684c1
  GNULIB_SETHOSTNAME=0;          AC_SUBST([GNULIB_SETHOSTNAME])
Packit Service 4684c1
  GNULIB_SLEEP=0;                AC_SUBST([GNULIB_SLEEP])
Packit Service 4684c1
  GNULIB_SYMLINK=0;              AC_SUBST([GNULIB_SYMLINK])
Packit Service 4684c1
  GNULIB_SYMLINKAT=0;            AC_SUBST([GNULIB_SYMLINKAT])
Packit Service 4684c1
  GNULIB_TRUNCATE=0;             AC_SUBST([GNULIB_TRUNCATE])
Packit Service 4684c1
  GNULIB_TTYNAME_R=0;            AC_SUBST([GNULIB_TTYNAME_R])
Packit Service 4684c1
  GNULIB_UNISTD_H_NONBLOCKING=0; AC_SUBST([GNULIB_UNISTD_H_NONBLOCKING])
Packit Service 4684c1
  GNULIB_UNISTD_H_SIGPIPE=0;     AC_SUBST([GNULIB_UNISTD_H_SIGPIPE])
Packit Service 4684c1
  GNULIB_UNLINK=0;               AC_SUBST([GNULIB_UNLINK])
Packit Service 4684c1
  GNULIB_UNLINKAT=0;             AC_SUBST([GNULIB_UNLINKAT])
Packit Service 4684c1
  GNULIB_USLEEP=0;               AC_SUBST([GNULIB_USLEEP])
Packit Service 4684c1
  GNULIB_WRITE=0;                AC_SUBST([GNULIB_WRITE])
Packit Service 4684c1
  dnl Assume proper GNU behavior unless another module says otherwise.
Packit Service 4684c1
  HAVE_CHOWN=1;           AC_SUBST([HAVE_CHOWN])
Packit Service 4684c1
  HAVE_COPY_FILE_RANGE=1; AC_SUBST([HAVE_COPY_FILE_RANGE])
Packit Service 4684c1
  HAVE_DUP2=1;            AC_SUBST([HAVE_DUP2])
Packit Service 4684c1
  HAVE_DUP3=1;            AC_SUBST([HAVE_DUP3])
Packit Service 4684c1
  HAVE_EUIDACCESS=1;      AC_SUBST([HAVE_EUIDACCESS])
Packit Service 4684c1
  HAVE_FACCESSAT=1;       AC_SUBST([HAVE_FACCESSAT])
Packit Service 4684c1
  HAVE_FCHDIR=1;          AC_SUBST([HAVE_FCHDIR])
Packit Service 4684c1
  HAVE_FCHOWNAT=1;        AC_SUBST([HAVE_FCHOWNAT])
Packit Service 4684c1
  HAVE_FDATASYNC=1;       AC_SUBST([HAVE_FDATASYNC])
Packit Service 4684c1
  HAVE_FSYNC=1;           AC_SUBST([HAVE_FSYNC])
Packit Service 4684c1
  HAVE_FTRUNCATE=1;       AC_SUBST([HAVE_FTRUNCATE])
Packit Service 4684c1
  HAVE_GETDTABLESIZE=1;   AC_SUBST([HAVE_GETDTABLESIZE])
Packit Service 4684c1
  HAVE_GETENTROPY=1;      AC_SUBST([HAVE_GETENTROPY])
Packit Service 4684c1
  HAVE_GETGROUPS=1;       AC_SUBST([HAVE_GETGROUPS])
Packit Service 4684c1
  HAVE_GETHOSTNAME=1;     AC_SUBST([HAVE_GETHOSTNAME])
Packit Service 4684c1
  HAVE_GETLOGIN=1;        AC_SUBST([HAVE_GETLOGIN])
Packit Service 4684c1
  HAVE_GETPAGESIZE=1;     AC_SUBST([HAVE_GETPAGESIZE])
Packit Service 4684c1
  HAVE_GETPASS=1;         AC_SUBST([HAVE_GETPASS])
Packit Service 4684c1
  HAVE_GETRANDOM=1;       AC_SUBST([HAVE_GETRANDOM])
Packit Service 4684c1
  HAVE_GROUP_MEMBER=1;    AC_SUBST([HAVE_GROUP_MEMBER])
Packit Service 4684c1
  HAVE_LCHOWN=1;          AC_SUBST([HAVE_LCHOWN])
Packit Service 4684c1
  HAVE_LINK=1;            AC_SUBST([HAVE_LINK])
Packit Service 4684c1
  HAVE_LINKAT=1;          AC_SUBST([HAVE_LINKAT])
Packit Service 4684c1
  HAVE_PIPE=1;            AC_SUBST([HAVE_PIPE])
Packit Service 4684c1
  HAVE_PIPE2=1;           AC_SUBST([HAVE_PIPE2])
Packit Service 4684c1
  HAVE_PREAD=1;           AC_SUBST([HAVE_PREAD])
Packit Service 4684c1
  HAVE_PWRITE=1;          AC_SUBST([HAVE_PWRITE])
Packit Service 4684c1
  HAVE_READLINK=1;        AC_SUBST([HAVE_READLINK])
Packit Service 4684c1
  HAVE_READLINKAT=1;      AC_SUBST([HAVE_READLINKAT])
Packit Service 4684c1
  HAVE_SETHOSTNAME=1;     AC_SUBST([HAVE_SETHOSTNAME])
Packit Service 4684c1
  HAVE_SLEEP=1;           AC_SUBST([HAVE_SLEEP])
Packit Service 4684c1
  HAVE_SYMLINK=1;         AC_SUBST([HAVE_SYMLINK])
Packit Service 4684c1
  HAVE_SYMLINKAT=1;       AC_SUBST([HAVE_SYMLINKAT])
Packit Service 4684c1
  HAVE_UNLINKAT=1;        AC_SUBST([HAVE_UNLINKAT])
Packit Service 4684c1
  HAVE_USLEEP=1;          AC_SUBST([HAVE_USLEEP])
Packit Service 4684c1
  HAVE_DECL_ENVIRON=1;    AC_SUBST([HAVE_DECL_ENVIRON])
Packit Service 4684c1
  HAVE_DECL_FCHDIR=1;     AC_SUBST([HAVE_DECL_FCHDIR])
Packit Service 4684c1
  HAVE_DECL_FDATASYNC=1;  AC_SUBST([HAVE_DECL_FDATASYNC])
Packit Service 4684c1
  HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME])
Packit Service 4684c1
  HAVE_DECL_GETLOGIN=1;   AC_SUBST([HAVE_DECL_GETLOGIN])
Packit Service 4684c1
  HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R])
Packit Service 4684c1
  HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE])
Packit Service 4684c1
  HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL])
Packit Service 4684c1
  HAVE_DECL_SETHOSTNAME=1; AC_SUBST([HAVE_DECL_SETHOSTNAME])
Packit Service 4684c1
  HAVE_DECL_TRUNCATE=1;   AC_SUBST([HAVE_DECL_TRUNCATE])
Packit Service 4684c1
  HAVE_DECL_TTYNAME_R=1;  AC_SUBST([HAVE_DECL_TTYNAME_R])
Packit Service 4684c1
  HAVE_OS_H=0;            AC_SUBST([HAVE_OS_H])
Packit Service 4684c1
  HAVE_SYS_PARAM_H=0;     AC_SUBST([HAVE_SYS_PARAM_H])
Packit Service 4684c1
  REPLACE_ACCESS=0;       AC_SUBST([REPLACE_ACCESS])
Packit Service 4684c1
  REPLACE_CHOWN=0;        AC_SUBST([REPLACE_CHOWN])
Packit Service 4684c1
  REPLACE_CLOSE=0;        AC_SUBST([REPLACE_CLOSE])
Packit Service 4684c1
  REPLACE_DUP=0;          AC_SUBST([REPLACE_DUP])
Packit Service 4684c1
  REPLACE_DUP2=0;         AC_SUBST([REPLACE_DUP2])
Packit Service 4684c1
  REPLACE_FACCESSAT=0;    AC_SUBST([REPLACE_FACCESSAT])
Packit Service 4684c1
  REPLACE_FCHOWNAT=0;     AC_SUBST([REPLACE_FCHOWNAT])
Packit Service 4684c1
  REPLACE_FTRUNCATE=0;    AC_SUBST([REPLACE_FTRUNCATE])
Packit Service 4684c1
  REPLACE_GETCWD=0;       AC_SUBST([REPLACE_GETCWD])
Packit Service 4684c1
  REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME])
Packit Service 4684c1
  REPLACE_GETDTABLESIZE=0; AC_SUBST([REPLACE_GETDTABLESIZE])
Packit Service 4684c1
  REPLACE_GETLOGIN_R=0;   AC_SUBST([REPLACE_GETLOGIN_R])
Packit Service 4684c1
  REPLACE_GETGROUPS=0;    AC_SUBST([REPLACE_GETGROUPS])
Packit Service 4684c1
  REPLACE_GETPAGESIZE=0;  AC_SUBST([REPLACE_GETPAGESIZE])
Packit Service 4684c1
  REPLACE_GETPASS=0;      AC_SUBST([REPLACE_GETPASS])
Packit Service 4684c1
  REPLACE_ISATTY=0;       AC_SUBST([REPLACE_ISATTY])
Packit Service 4684c1
  REPLACE_LCHOWN=0;       AC_SUBST([REPLACE_LCHOWN])
Packit Service 4684c1
  REPLACE_LINK=0;         AC_SUBST([REPLACE_LINK])
Packit Service 4684c1
  REPLACE_LINKAT=0;       AC_SUBST([REPLACE_LINKAT])
Packit Service 4684c1
  REPLACE_LSEEK=0;        AC_SUBST([REPLACE_LSEEK])
Packit Service 4684c1
  REPLACE_PREAD=0;        AC_SUBST([REPLACE_PREAD])
Packit Service 4684c1
  REPLACE_PWRITE=0;       AC_SUBST([REPLACE_PWRITE])
Packit Service 4684c1
  REPLACE_READ=0;         AC_SUBST([REPLACE_READ])
Packit Service 4684c1
  REPLACE_READLINK=0;     AC_SUBST([REPLACE_READLINK])
Packit Service 4684c1
  REPLACE_READLINKAT=0;   AC_SUBST([REPLACE_READLINKAT])
Packit Service 4684c1
  REPLACE_RMDIR=0;        AC_SUBST([REPLACE_RMDIR])
Packit Service 4684c1
  REPLACE_SLEEP=0;        AC_SUBST([REPLACE_SLEEP])
Packit Service 4684c1
  REPLACE_SYMLINK=0;      AC_SUBST([REPLACE_SYMLINK])
Packit Service 4684c1
  REPLACE_SYMLINKAT=0;    AC_SUBST([REPLACE_SYMLINKAT])
Packit Service 4684c1
  REPLACE_TRUNCATE=0;     AC_SUBST([REPLACE_TRUNCATE])
Packit Service 4684c1
  REPLACE_TTYNAME_R=0;    AC_SUBST([REPLACE_TTYNAME_R])
Packit Service 4684c1
  REPLACE_UNLINK=0;       AC_SUBST([REPLACE_UNLINK])
Packit Service 4684c1
  REPLACE_UNLINKAT=0;     AC_SUBST([REPLACE_UNLINKAT])
Packit Service 4684c1
  REPLACE_USLEEP=0;       AC_SUBST([REPLACE_USLEEP])
Packit Service 4684c1
  REPLACE_WRITE=0;        AC_SUBST([REPLACE_WRITE])
Packit Service 4684c1
  UNISTD_H_HAVE_WINSOCK2_H=0; AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H])
Packit Service 4684c1
  UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
Packit Service 4684c1
                           AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS])
Packit Service 4684c1
])