Blame lib/unistd.in.h

Packit Service a2489d
/* Substitute for and wrapper around <unistd.h>.
Packit Service a2489d
   Copyright (C) 2003-2018 Free Software Foundation, Inc.
Packit Service a2489d
Packit Service a2489d
   This program is free software; you can redistribute it and/or modify
Packit Service a2489d
   it under the terms of the GNU General Public License as published by
Packit Service a2489d
   the Free Software Foundation; either version 3, or (at your option)
Packit Service a2489d
   any later version.
Packit Service a2489d
Packit Service a2489d
   This program is distributed in the hope that it will be useful,
Packit Service a2489d
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service a2489d
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service a2489d
   GNU General Public License for more details.
Packit Service a2489d
Packit Service a2489d
   You should have received a copy of the GNU General Public License
Packit Service a2489d
   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
Packit Service a2489d
Packit Service a2489d
#ifndef _@GUARD_PREFIX@_UNISTD_H
Packit Service a2489d
Packit Service a2489d
#if __GNUC__ >= 3
Packit Service a2489d
@PRAGMA_SYSTEM_HEADER@
Packit Service a2489d
#endif
Packit Service a2489d
@PRAGMA_COLUMNS@
Packit Service a2489d
Packit Service a2489d
#ifdef _GL_INCLUDING_UNISTD_H
Packit Service a2489d
/* Special invocation convention:
Packit Service a2489d
   - On Mac OS X 10.3.9 we have a sequence of nested includes
Packit Service a2489d
     <unistd.h> -> <signal.h> -> <pthread.h> -> <unistd.h>
Packit Service a2489d
     In this situation, the functions are not yet declared, therefore we cannot
Packit Service a2489d
     provide the C++ aliases.  */
Packit Service a2489d
Packit Service a2489d
#@INCLUDE_NEXT@ @NEXT_UNISTD_H@
Packit Service a2489d
Packit Service a2489d
#else
Packit Service a2489d
/* Normal invocation convention.  */
Packit Service a2489d
Packit Service a2489d
/* The include_next requires a split double-inclusion guard.  */
Packit Service a2489d
#if @HAVE_UNISTD_H@
Packit Service a2489d
# define _GL_INCLUDING_UNISTD_H
Packit Service a2489d
# @INCLUDE_NEXT@ @NEXT_UNISTD_H@
Packit Service a2489d
# undef _GL_INCLUDING_UNISTD_H
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
/* Get all possible declarations of gethostname().  */
Packit Service a2489d
#if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \
Packit Service a2489d
  && !defined _GL_INCLUDING_WINSOCK2_H
Packit Service a2489d
# define _GL_INCLUDING_WINSOCK2_H
Packit Service a2489d
# include <winsock2.h>
Packit Service a2489d
# undef _GL_INCLUDING_WINSOCK2_H
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#if !defined _@GUARD_PREFIX@_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H
Packit Service a2489d
#define _@GUARD_PREFIX@_UNISTD_H
Packit Service a2489d
Packit Service a2489d
/* NetBSD 5.0 mis-defines NULL.  Also get size_t.  */
Packit Service a2489d
#include <stddef.h>
Packit Service a2489d
Packit Service a2489d
/* mingw doesn't define the SEEK_* or *_FILENO macros in <unistd.h>.  */
Packit Service a2489d
/* MSVC declares 'unlink' in <stdio.h>, not in <unistd.h>.  We must include
Packit Service a2489d
   it before we  #define unlink rpl_unlink.  */
Packit Service a2489d
/* Cygwin 1.7.1 declares symlinkat in <stdio.h>, not in <unistd.h>.  */
Packit Service a2489d
/* But avoid namespace pollution on glibc systems.  */
Packit Service a2489d
#if (!(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) \
Packit Service a2489d
     || ((@GNULIB_UNLINK@ || defined GNULIB_POSIXCHECK) \
Packit Service a2489d
         && (defined _WIN32 && ! defined __CYGWIN__)) \
Packit Service a2489d
     || ((@GNULIB_SYMLINKAT@ || defined GNULIB_POSIXCHECK) \
Packit Service a2489d
         && defined __CYGWIN__)) \
Packit Service a2489d
    && ! defined __GLIBC__
Packit Service a2489d
# include <stdio.h>
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
/* Cygwin 1.7.1 declares unlinkat in <fcntl.h>, not in <unistd.h>.  */
Packit Service a2489d
/* But avoid namespace pollution on glibc systems.  */
Packit Service a2489d
#if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) && defined __CYGWIN__ \
Packit Service a2489d
    && ! defined __GLIBC__
Packit Service a2489d
# include <fcntl.h>
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
/* mingw fails to declare _exit in <unistd.h>.  */
Packit Service a2489d
/* mingw, MSVC, BeOS, Haiku declare environ in <stdlib.h>, not in
Packit Service a2489d
   <unistd.h>.  */
Packit Service a2489d
/* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>.  */
Packit Service a2489d
/* OSF Tru64 Unix cannot see gnulib rpl_strtod when system <stdlib.h> is
Packit Service a2489d
   included here.  */
Packit Service a2489d
/* But avoid namespace pollution on glibc systems.  */
Packit Service a2489d
#if !defined __GLIBC__ && !defined __osf__
Packit Service a2489d
# define __need_system_stdlib_h
Packit Service a2489d
# include <stdlib.h>
Packit Service a2489d
# undef __need_system_stdlib_h
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
/* Native Windows platforms declare chdir, getcwd, rmdir in
Packit Service a2489d
   <io.h> and/or <direct.h>, not in <unistd.h>.
Packit Service a2489d
   They also declare access(), chmod(), close(), dup(), dup2(), isatty(),
Packit Service a2489d
   lseek(), read(), unlink(), write() in <io.h>.  */
Packit Service a2489d
#if ((@GNULIB_CHDIR@ || @GNULIB_GETCWD@ || @GNULIB_RMDIR@ \
Packit Service a2489d
      || defined GNULIB_POSIXCHECK) \
Packit Service a2489d
     && (defined _WIN32 && ! defined __CYGWIN__))
Packit Service a2489d
# include <io.h>     /* mingw32, mingw64 */
Packit Service a2489d
# include <direct.h> /* mingw64, MSVC 9 */
Packit Service a2489d
#elif (@GNULIB_CLOSE@ || @GNULIB_DUP@ || @GNULIB_DUP2@ || @GNULIB_ISATTY@ \
Packit Service a2489d
       || @GNULIB_LSEEK@ || @GNULIB_READ@ || @GNULIB_UNLINK@ || @GNULIB_WRITE@ \
Packit Service a2489d
       || defined GNULIB_POSIXCHECK) \
Packit Service a2489d
      && (defined _WIN32 && ! defined __CYGWIN__)
Packit Service a2489d
# include <io.h>
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
/* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>.
Packit Service a2489d
   NonStop Kernel declares gethostname in <netdb.h>, not in <unistd.h>.  */
Packit Service a2489d
/* But avoid namespace pollution on glibc systems.  */
Packit Service a2489d
#if ((@GNULIB_GETDOMAINNAME@ && (defined _AIX || defined __osf__)) \
Packit Service a2489d
     || (@GNULIB_GETHOSTNAME@ && defined __TANDEM)) \
Packit Service a2489d
    && !defined __GLIBC__
Packit Service a2489d
# include <netdb.h>
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
/* MSVC defines off_t in <sys/types.h>.
Packit Service a2489d
   May also define off_t to a 64-bit type on native Windows.  */
Packit Service a2489d
#if !@HAVE_UNISTD_H@ || @WINDOWS_64_BIT_OFF_T@
Packit Service a2489d
/* Get off_t.  */
Packit Service a2489d
# include <sys/types.h>
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#if (@GNULIB_READ@ || @GNULIB_WRITE@ \
Packit Service a2489d
     || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \
Packit Service a2489d
     || @GNULIB_PREAD@ || @GNULIB_PWRITE@ || defined GNULIB_POSIXCHECK)
Packit Service a2489d
/* Get ssize_t.  */
Packit Service a2489d
# include <sys/types.h>
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
Packit Service a2489d
Packit Service a2489d
/* The definition of _GL_ARG_NONNULL is copied here.  */
Packit Service a2489d
Packit Service a2489d
/* The definition of _GL_WARN_ON_USE is copied here.  */
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
/* Get getopt(), optarg, optind, opterr, optopt.  */
Packit Service a2489d
#if @GNULIB_UNISTD_H_GETOPT@ && !defined _GL_SYSTEM_GETOPT
Packit Service a2489d
# include <getopt-cdefs.h>
Packit Service a2489d
# include <getopt-pfx-core.h>
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#ifndef _GL_INLINE_HEADER_BEGIN
Packit Service a2489d
 #error "Please include config.h first."
Packit Service a2489d
#endif
Packit Service a2489d
_GL_INLINE_HEADER_BEGIN
Packit Service a2489d
#ifndef _GL_UNISTD_INLINE
Packit Service a2489d
# define _GL_UNISTD_INLINE _GL_INLINE
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
/* Hide some function declarations from <winsock2.h>.  */
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@
Packit Service a2489d
# if !defined _@GUARD_PREFIX@_SYS_SOCKET_H
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef socket
Packit Service a2489d
#   define socket              socket_used_without_including_sys_socket_h
Packit Service a2489d
#   undef connect
Packit Service a2489d
#   define connect             connect_used_without_including_sys_socket_h
Packit Service a2489d
#   undef accept
Packit Service a2489d
#   define accept              accept_used_without_including_sys_socket_h
Packit Service a2489d
#   undef bind
Packit Service a2489d
#   define bind                bind_used_without_including_sys_socket_h
Packit Service a2489d
#   undef getpeername
Packit Service a2489d
#   define getpeername         getpeername_used_without_including_sys_socket_h
Packit Service a2489d
#   undef getsockname
Packit Service a2489d
#   define getsockname         getsockname_used_without_including_sys_socket_h
Packit Service a2489d
#   undef getsockopt
Packit Service a2489d
#   define getsockopt          getsockopt_used_without_including_sys_socket_h
Packit Service a2489d
#   undef listen
Packit Service a2489d
#   define listen              listen_used_without_including_sys_socket_h
Packit Service a2489d
#   undef recv
Packit Service a2489d
#   define recv                recv_used_without_including_sys_socket_h
Packit Service a2489d
#   undef send
Packit Service a2489d
#   define send                send_used_without_including_sys_socket_h
Packit Service a2489d
#   undef recvfrom
Packit Service a2489d
#   define recvfrom            recvfrom_used_without_including_sys_socket_h
Packit Service a2489d
#   undef sendto
Packit Service a2489d
#   define sendto              sendto_used_without_including_sys_socket_h
Packit Service a2489d
#   undef setsockopt
Packit Service a2489d
#   define setsockopt          setsockopt_used_without_including_sys_socket_h
Packit Service a2489d
#   undef shutdown
Packit Service a2489d
#   define shutdown            shutdown_used_without_including_sys_socket_h
Packit Service a2489d
#  else
Packit Service a2489d
    _GL_WARN_ON_USE (socket,
Packit Service a2489d
                     "socket() used without including <sys/socket.h>");
Packit Service a2489d
    _GL_WARN_ON_USE (connect,
Packit Service a2489d
                     "connect() used without including <sys/socket.h>");
Packit Service a2489d
    _GL_WARN_ON_USE (accept,
Packit Service a2489d
                     "accept() used without including <sys/socket.h>");
Packit Service a2489d
    _GL_WARN_ON_USE (bind,
Packit Service a2489d
                     "bind() used without including <sys/socket.h>");
Packit Service a2489d
    _GL_WARN_ON_USE (getpeername,
Packit Service a2489d
                     "getpeername() used without including <sys/socket.h>");
Packit Service a2489d
    _GL_WARN_ON_USE (getsockname,
Packit Service a2489d
                     "getsockname() used without including <sys/socket.h>");
Packit Service a2489d
    _GL_WARN_ON_USE (getsockopt,
Packit Service a2489d
                     "getsockopt() used without including <sys/socket.h>");
Packit Service a2489d
    _GL_WARN_ON_USE (listen,
Packit Service a2489d
                     "listen() used without including <sys/socket.h>");
Packit Service a2489d
    _GL_WARN_ON_USE (recv,
Packit Service a2489d
                     "recv() used without including <sys/socket.h>");
Packit Service a2489d
    _GL_WARN_ON_USE (send,
Packit Service a2489d
                     "send() used without including <sys/socket.h>");
Packit Service a2489d
    _GL_WARN_ON_USE (recvfrom,
Packit Service a2489d
                     "recvfrom() used without including <sys/socket.h>");
Packit Service a2489d
    _GL_WARN_ON_USE (sendto,
Packit Service a2489d
                     "sendto() used without including <sys/socket.h>");
Packit Service a2489d
    _GL_WARN_ON_USE (setsockopt,
Packit Service a2489d
                     "setsockopt() used without including <sys/socket.h>");
Packit Service a2489d
    _GL_WARN_ON_USE (shutdown,
Packit Service a2489d
                     "shutdown() used without including <sys/socket.h>");
Packit Service a2489d
#  endif
Packit Service a2489d
# endif
Packit Service a2489d
# if !defined _@GUARD_PREFIX@_SYS_SELECT_H
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef select
Packit Service a2489d
#   define select              select_used_without_including_sys_select_h
Packit Service a2489d
#  else
Packit Service a2489d
    _GL_WARN_ON_USE (select,
Packit Service a2489d
                     "select() used without including <sys/select.h>");
Packit Service a2489d
#  endif
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
/* OS/2 EMX lacks these macros.  */
Packit Service a2489d
#ifndef STDIN_FILENO
Packit Service a2489d
# define STDIN_FILENO 0
Packit Service a2489d
#endif
Packit Service a2489d
#ifndef STDOUT_FILENO
Packit Service a2489d
# define STDOUT_FILENO 1
Packit Service a2489d
#endif
Packit Service a2489d
#ifndef STDERR_FILENO
Packit Service a2489d
# define STDERR_FILENO 2
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
/* Ensure *_OK macros exist.  */
Packit Service a2489d
#ifndef F_OK
Packit Service a2489d
# define F_OK 0
Packit Service a2489d
# define X_OK 1
Packit Service a2489d
# define W_OK 2
Packit Service a2489d
# define R_OK 4
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
/* Declare overridden functions.  */
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if defined GNULIB_POSIXCHECK
Packit Service a2489d
/* The access() function is a security risk.  */
Packit Service a2489d
_GL_WARN_ON_USE (access, "the access function is a security risk - "
Packit Service a2489d
                 "use the gnulib module faccessat instead");
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_CHDIR@
Packit Service a2489d
_GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1)));
Packit Service a2489d
_GL_CXXALIASWARN (chdir);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef chdir
Packit Service a2489d
# if HAVE_RAW_DECL_CHDIR
Packit Service a2489d
_GL_WARN_ON_USE (chown, "chdir is not always in <unistd.h> - "
Packit Service a2489d
                 "use gnulib module chdir for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_CHOWN@
Packit Service a2489d
/* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
Packit Service a2489d
   to GID (if GID is not -1).  Follow symbolic links.
Packit Service a2489d
   Return 0 if successful, otherwise -1 and errno set.
Packit Service a2489d
   See the POSIX:2008 specification
Packit Service a2489d
   
Packit Service a2489d
# if @REPLACE_CHOWN@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef chown
Packit Service a2489d
#   define chown rpl_chown
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (chown, int, (const char *file, uid_t uid, gid_t gid)
Packit Service a2489d
                              _GL_ARG_NONNULL ((1)));
Packit Service a2489d
_GL_CXXALIAS_RPL (chown, int, (const char *file, uid_t uid, gid_t gid));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_CHOWN@
Packit Service a2489d
_GL_FUNCDECL_SYS (chown, int, (const char *file, uid_t uid, gid_t gid)
Packit Service a2489d
                              _GL_ARG_NONNULL ((1)));
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_SYS (chown, int, (const char *file, uid_t uid, gid_t gid));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (chown);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef chown
Packit Service a2489d
# if HAVE_RAW_DECL_CHOWN
Packit Service a2489d
_GL_WARN_ON_USE (chown, "chown fails to follow symlinks on some systems and "
Packit Service a2489d
                 "doesn't treat a uid or gid of -1 on some systems - "
Packit Service a2489d
                 "use gnulib module chown for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_CLOSE@
Packit Service a2489d
# if @REPLACE_CLOSE@
Packit Service a2489d
/* Automatically included by modules that need a replacement for close.  */
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef close
Packit Service a2489d
#   define close rpl_close
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (close, int, (int fd));
Packit Service a2489d
_GL_CXXALIAS_RPL (close, int, (int fd));
Packit Service a2489d
# else
Packit Service a2489d
_GL_CXXALIAS_SYS (close, int, (int fd));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (close);
Packit Service a2489d
#elif @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
Packit Service a2489d
# undef close
Packit Service a2489d
# define close close_used_without_requesting_gnulib_module_close
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef close
Packit Service a2489d
/* Assume close is always declared.  */
Packit Service a2489d
_GL_WARN_ON_USE (close, "close does not portably work on sockets - "
Packit Service a2489d
                 "use gnulib module close for portability");
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_DUP@
Packit Service a2489d
# if @REPLACE_DUP@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   define dup rpl_dup
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (dup, int, (int oldfd));
Packit Service a2489d
_GL_CXXALIAS_RPL (dup, int, (int oldfd));
Packit Service a2489d
# else
Packit Service a2489d
_GL_CXXALIAS_SYS (dup, int, (int oldfd));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (dup);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef dup
Packit Service a2489d
# if HAVE_RAW_DECL_DUP
Packit Service a2489d
_GL_WARN_ON_USE (dup, "dup is unportable - "
Packit Service a2489d
                 "use gnulib module dup for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_DUP2@
Packit Service a2489d
/* Copy the file descriptor OLDFD into file descriptor NEWFD.  Do nothing if
Packit Service a2489d
   NEWFD = OLDFD, otherwise close NEWFD first if it is open.
Packit Service a2489d
   Return newfd if successful, otherwise -1 and errno set.
Packit Service a2489d
   See the POSIX:2008 specification
Packit Service a2489d
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/dup2.html>.  */
Packit Service a2489d
# if @REPLACE_DUP2@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   define dup2 rpl_dup2
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd));
Packit Service a2489d
_GL_CXXALIAS_RPL (dup2, int, (int oldfd, int newfd));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_DUP2@
Packit Service a2489d
_GL_FUNCDECL_SYS (dup2, int, (int oldfd, int newfd));
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (dup2);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef dup2
Packit Service a2489d
# if HAVE_RAW_DECL_DUP2
Packit Service a2489d
_GL_WARN_ON_USE (dup2, "dup2 is unportable - "
Packit Service a2489d
                 "use gnulib module dup2 for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_DUP3@
Packit Service a2489d
/* Copy the file descriptor OLDFD into file descriptor NEWFD, with the
Packit Service a2489d
   specified flags.
Packit Service a2489d
   The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
Packit Service a2489d
   and O_TEXT, O_BINARY (defined in "binary-io.h").
Packit Service a2489d
   Close NEWFD first if it is open.
Packit Service a2489d
   Return newfd if successful, otherwise -1 and errno set.
Packit Service a2489d
   See the Linux man page at
Packit Service a2489d
   <https://www.kernel.org/doc/man-pages/online/pages/man2/dup3.2.html>.  */
Packit Service a2489d
# if @HAVE_DUP3@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   define dup3 rpl_dup3
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (dup3, int, (int oldfd, int newfd, int flags));
Packit Service a2489d
_GL_CXXALIAS_RPL (dup3, int, (int oldfd, int newfd, int flags));
Packit Service a2489d
# else
Packit Service a2489d
_GL_FUNCDECL_SYS (dup3, int, (int oldfd, int newfd, int flags));
Packit Service a2489d
_GL_CXXALIAS_SYS (dup3, int, (int oldfd, int newfd, int flags));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (dup3);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef dup3
Packit Service a2489d
# if HAVE_RAW_DECL_DUP3
Packit Service a2489d
_GL_WARN_ON_USE (dup3, "dup3 is unportable - "
Packit Service a2489d
                 "use gnulib module dup3 for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_ENVIRON@
Packit Service a2489d
# if defined __CYGWIN__ && !defined __i386__
Packit Service a2489d
/* The 'environ' variable is defined in a DLL. Therefore its declaration needs
Packit Service a2489d
   the '__declspec(dllimport)' attribute, but the system's <unistd.h> lacks it.
Packit Service a2489d
   This leads to a link error on 64-bit Cygwin when the option
Packit Service a2489d
   -Wl,--disable-auto-import is in use.  */
Packit Service a2489d
_GL_EXTERN_C __declspec(dllimport) char **environ;
Packit Service a2489d
# endif
Packit Service a2489d
# if !@HAVE_DECL_ENVIRON@
Packit Service a2489d
/* Set of environment variables and values.  An array of strings of the form
Packit Service a2489d
   "VARIABLE=VALUE", terminated with a NULL.  */
Packit Service a2489d
#  if defined __APPLE__ && defined __MACH__
Packit Service a2489d
#   include <TargetConditionals.h>
Packit Service a2489d
#   if !TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR
Packit Service a2489d
#    define _GL_USE_CRT_EXTERNS
Packit Service a2489d
#   endif
Packit Service a2489d
#  endif
Packit Service a2489d
#  ifdef _GL_USE_CRT_EXTERNS
Packit Service a2489d
#   include <crt_externs.h>
Packit Service a2489d
#   define environ (*_NSGetEnviron ())
Packit Service a2489d
#  else
Packit Service a2489d
#   ifdef __cplusplus
Packit Service a2489d
extern "C" {
Packit Service a2489d
#   endif
Packit Service a2489d
extern char **environ;
Packit Service a2489d
#   ifdef __cplusplus
Packit Service a2489d
}
Packit Service a2489d
#   endif
Packit Service a2489d
#  endif
Packit Service a2489d
# endif
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# if HAVE_RAW_DECL_ENVIRON
Packit Service a2489d
_GL_UNISTD_INLINE char ***
Packit Service a2489d
rpl_environ (void)
Packit Service a2489d
{
Packit Service a2489d
  return &environ;
Packit Service a2489d
}
Packit Service a2489d
_GL_WARN_ON_USE (rpl_environ, "environ is unportable - "
Packit Service a2489d
                 "use gnulib module environ for portability");
Packit Service a2489d
#  undef environ
Packit Service a2489d
#  define environ (*rpl_environ ())
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_EUIDACCESS@
Packit Service a2489d
/* Like access(), except that it uses the effective user id and group id of
Packit Service a2489d
   the current process.  */
Packit Service a2489d
# if !@HAVE_EUIDACCESS@
Packit Service a2489d
_GL_FUNCDECL_SYS (euidaccess, int, (const char *filename, int mode)
Packit Service a2489d
                                   _GL_ARG_NONNULL ((1)));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIAS_SYS (euidaccess, int, (const char *filename, int mode));
Packit Service a2489d
_GL_CXXALIASWARN (euidaccess);
Packit Service a2489d
# if defined GNULIB_POSIXCHECK
Packit Service a2489d
/* Like access(), this function is a security risk.  */
Packit Service a2489d
_GL_WARN_ON_USE (euidaccess, "the euidaccess function is a security risk - "
Packit Service a2489d
                 "use the gnulib module faccessat instead");
Packit Service a2489d
# endif
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef euidaccess
Packit Service a2489d
# if HAVE_RAW_DECL_EUIDACCESS
Packit Service a2489d
_GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - "
Packit Service a2489d
                 "use gnulib module euidaccess for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_FACCESSAT@
Packit Service a2489d
# if @REPLACE_FACCESSAT@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef faccessat
Packit Service a2489d
#   define faccessat rpl_faccessat
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (faccessat, int,
Packit Service a2489d
                  (int fd, char const *name, int mode, int flag)
Packit Service a2489d
                  _GL_ARG_NONNULL ((2)));
Packit Service a2489d
_GL_CXXALIAS_RPL (faccessat, int,
Packit Service a2489d
                  (int fd, char const *name, int mode, int flag));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_FACCESSAT@
Packit Service a2489d
_GL_FUNCDECL_SYS (faccessat, int,
Packit Service a2489d
                  (int fd, char const *file, int mode, int flag)
Packit Service a2489d
                  _GL_ARG_NONNULL ((2)));
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_SYS (faccessat, int,
Packit Service a2489d
                  (int fd, char const *file, int mode, int flag));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (faccessat);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef faccessat
Packit Service a2489d
# if HAVE_RAW_DECL_FACCESSAT
Packit Service a2489d
_GL_WARN_ON_USE (faccessat, "faccessat is not portable - "
Packit Service a2489d
                 "use gnulib module faccessat for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_FCHDIR@
Packit Service a2489d
/* Change the process' current working directory to the directory on which
Packit Service a2489d
   the given file descriptor is open.
Packit Service a2489d
   Return 0 if successful, otherwise -1 and errno set.
Packit Service a2489d
   See the POSIX:2008 specification
Packit Service a2489d
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/fchdir.html>.  */
Packit Service a2489d
# if ! @HAVE_FCHDIR@
Packit Service a2489d
_GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/));
Packit Service a2489d
Packit Service a2489d
/* Gnulib internal hooks needed to maintain the fchdir metadata.  */
Packit Service a2489d
_GL_EXTERN_C int _gl_register_fd (int fd, const char *filename)
Packit Service a2489d
     _GL_ARG_NONNULL ((2));
Packit Service a2489d
_GL_EXTERN_C void _gl_unregister_fd (int fd);
Packit Service a2489d
_GL_EXTERN_C int _gl_register_dup (int oldfd, int newfd);
Packit Service a2489d
_GL_EXTERN_C const char *_gl_directory_name (int fd);
Packit Service a2489d
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_DECL_FCHDIR@
Packit Service a2489d
_GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/));
Packit Service a2489d
#  endif
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIAS_SYS (fchdir, int, (int /*fd*/));
Packit Service a2489d
_GL_CXXALIASWARN (fchdir);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef fchdir
Packit Service a2489d
# if HAVE_RAW_DECL_FCHDIR
Packit Service a2489d
_GL_WARN_ON_USE (fchdir, "fchdir is unportable - "
Packit Service a2489d
                 "use gnulib module fchdir for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_FCHOWNAT@
Packit Service a2489d
# if @REPLACE_FCHOWNAT@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef fchownat
Packit Service a2489d
#   define fchownat rpl_fchownat
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (fchownat, int, (int fd, char const *file,
Packit Service a2489d
                                  uid_t owner, gid_t group, int flag)
Packit Service a2489d
                                 _GL_ARG_NONNULL ((2)));
Packit Service a2489d
_GL_CXXALIAS_RPL (fchownat, int, (int fd, char const *file,
Packit Service a2489d
                                  uid_t owner, gid_t group, int flag));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_FCHOWNAT@
Packit Service a2489d
_GL_FUNCDECL_SYS (fchownat, int, (int fd, char const *file,
Packit Service a2489d
                                  uid_t owner, gid_t group, int flag)
Packit Service a2489d
                                 _GL_ARG_NONNULL ((2)));
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_SYS (fchownat, int, (int fd, char const *file,
Packit Service a2489d
                                  uid_t owner, gid_t group, int flag));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (fchownat);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef fchownat
Packit Service a2489d
# if HAVE_RAW_DECL_FCHOWNAT
Packit Service a2489d
_GL_WARN_ON_USE (fchownat, "fchownat is not portable - "
Packit Service a2489d
                 "use gnulib module openat for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_FDATASYNC@
Packit Service a2489d
/* Synchronize changes to a file.
Packit Service a2489d
   Return 0 if successful, otherwise -1 and errno set.
Packit Service a2489d
   See POSIX:2008 specification
Packit Service a2489d
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html>.  */
Packit Service a2489d
# if !@HAVE_FDATASYNC@ || !@HAVE_DECL_FDATASYNC@
Packit Service a2489d
_GL_FUNCDECL_SYS (fdatasync, int, (int fd));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIAS_SYS (fdatasync, int, (int fd));
Packit Service a2489d
_GL_CXXALIASWARN (fdatasync);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef fdatasync
Packit Service a2489d
# if HAVE_RAW_DECL_FDATASYNC
Packit Service a2489d
_GL_WARN_ON_USE (fdatasync, "fdatasync is unportable - "
Packit Service a2489d
                 "use gnulib module fdatasync for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_FSYNC@
Packit Service a2489d
/* Synchronize changes, including metadata, to a file.
Packit Service a2489d
   Return 0 if successful, otherwise -1 and errno set.
Packit Service a2489d
   See POSIX:2008 specification
Packit Service a2489d
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html>.  */
Packit Service a2489d
# if !@HAVE_FSYNC@
Packit Service a2489d
_GL_FUNCDECL_SYS (fsync, int, (int fd));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIAS_SYS (fsync, int, (int fd));
Packit Service a2489d
_GL_CXXALIASWARN (fsync);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef fsync
Packit Service a2489d
# if HAVE_RAW_DECL_FSYNC
Packit Service a2489d
_GL_WARN_ON_USE (fsync, "fsync is unportable - "
Packit Service a2489d
                 "use gnulib module fsync for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_FTRUNCATE@
Packit Service a2489d
/* Change the size of the file to which FD is opened to become equal to LENGTH.
Packit Service a2489d
   Return 0 if successful, otherwise -1 and errno set.
Packit Service a2489d
   See the POSIX:2008 specification
Packit Service a2489d
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html>.  */
Packit Service a2489d
# if @REPLACE_FTRUNCATE@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef ftruncate
Packit Service a2489d
#   define ftruncate rpl_ftruncate
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (ftruncate, int, (int fd, off_t length));
Packit Service a2489d
_GL_CXXALIAS_RPL (ftruncate, int, (int fd, off_t length));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_FTRUNCATE@
Packit Service a2489d
_GL_FUNCDECL_SYS (ftruncate, int, (int fd, off_t length));
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_SYS (ftruncate, int, (int fd, off_t length));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (ftruncate);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef ftruncate
Packit Service a2489d
# if HAVE_RAW_DECL_FTRUNCATE
Packit Service a2489d
_GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - "
Packit Service a2489d
                 "use gnulib module ftruncate for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_GETCWD@
Packit Service a2489d
/* Get the name of the current working directory, and put it in SIZE bytes
Packit Service a2489d
   of BUF.
Packit Service a2489d
   Return BUF if successful, or NULL if the directory couldn't be determined
Packit Service a2489d
   or SIZE was too small.
Packit Service a2489d
   See the POSIX:2008 specification
Packit Service a2489d
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/getcwd.html>.
Packit Service a2489d
   Additionally, the gnulib module 'getcwd' guarantees the following GNU
Packit Service a2489d
   extension: If BUF is NULL, an array is allocated with 'malloc'; the array
Packit Service a2489d
   is SIZE bytes long, unless SIZE == 0, in which case it is as big as
Packit Service a2489d
   necessary.  */
Packit Service a2489d
# if @REPLACE_GETCWD@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   define getcwd rpl_getcwd
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size));
Packit Service a2489d
_GL_CXXALIAS_RPL (getcwd, char *, (char *buf, size_t size));
Packit Service a2489d
# else
Packit Service a2489d
/* Need to cast, because on mingw, the second parameter is
Packit Service a2489d
                                                   int size.  */
Packit Service a2489d
_GL_CXXALIAS_SYS_CAST (getcwd, char *, (char *buf, size_t size));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (getcwd);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef getcwd
Packit Service a2489d
# if HAVE_RAW_DECL_GETCWD
Packit Service a2489d
_GL_WARN_ON_USE (getcwd, "getcwd is unportable - "
Packit Service a2489d
                 "use gnulib module getcwd for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_GETDOMAINNAME@
Packit Service a2489d
/* Return the NIS domain name of the machine.
Packit Service a2489d
   WARNING! The NIS domain name is unrelated to the fully qualified host name
Packit Service a2489d
            of the machine.  It is also unrelated to email addresses.
Packit Service a2489d
   WARNING! The NIS domain name is usually the empty string or "(none)" when
Packit Service a2489d
            not using NIS.
Packit Service a2489d
Packit Service a2489d
   Put up to LEN bytes of the NIS domain name into NAME.
Packit Service a2489d
   Null terminate it if the name is shorter than LEN.
Packit Service a2489d
   If the NIS domain name is longer than LEN, set errno = EINVAL and return -1.
Packit Service a2489d
   Return 0 if successful, otherwise set errno and return -1.  */
Packit Service a2489d
# if @REPLACE_GETDOMAINNAME@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef getdomainname
Packit Service a2489d
#   define getdomainname rpl_getdomainname
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (getdomainname, int, (char *name, size_t len)
Packit Service a2489d
                                      _GL_ARG_NONNULL ((1)));
Packit Service a2489d
_GL_CXXALIAS_RPL (getdomainname, int, (char *name, size_t len));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_DECL_GETDOMAINNAME@
Packit Service a2489d
_GL_FUNCDECL_SYS (getdomainname, int, (char *name, size_t len)
Packit Service a2489d
                                      _GL_ARG_NONNULL ((1)));
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_SYS (getdomainname, int, (char *name, size_t len));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (getdomainname);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef getdomainname
Packit Service a2489d
# if HAVE_RAW_DECL_GETDOMAINNAME
Packit Service a2489d
_GL_WARN_ON_USE (getdomainname, "getdomainname is unportable - "
Packit Service a2489d
                 "use gnulib module getdomainname for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_GETDTABLESIZE@
Packit Service a2489d
/* Return the maximum number of file descriptors in the current process.
Packit Service a2489d
   In POSIX, this is same as sysconf (_SC_OPEN_MAX).  */
Packit Service a2489d
# if @REPLACE_GETDTABLESIZE@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef getdtablesize
Packit Service a2489d
#   define getdtablesize rpl_getdtablesize
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (getdtablesize, int, (void));
Packit Service a2489d
_GL_CXXALIAS_RPL (getdtablesize, int, (void));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_GETDTABLESIZE@
Packit Service a2489d
_GL_FUNCDECL_SYS (getdtablesize, int, (void));
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_SYS (getdtablesize, int, (void));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (getdtablesize);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef getdtablesize
Packit Service a2489d
# if HAVE_RAW_DECL_GETDTABLESIZE
Packit Service a2489d
_GL_WARN_ON_USE (getdtablesize, "getdtablesize is unportable - "
Packit Service a2489d
                 "use gnulib module getdtablesize for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_GETGROUPS@
Packit Service a2489d
/* Return the supplemental groups that the current process belongs to.
Packit Service a2489d
   It is unspecified whether the effective group id is in the list.
Packit Service a2489d
   If N is 0, return the group count; otherwise, N describes how many
Packit Service a2489d
   entries are available in GROUPS.  Return -1 and set errno if N is
Packit Service a2489d
   not 0 and not large enough.  Fails with ENOSYS on some systems.  */
Packit Service a2489d
# if @REPLACE_GETGROUPS@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef getgroups
Packit Service a2489d
#   define getgroups rpl_getgroups
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (getgroups, int, (int n, gid_t *groups));
Packit Service a2489d
_GL_CXXALIAS_RPL (getgroups, int, (int n, gid_t *groups));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_GETGROUPS@
Packit Service a2489d
_GL_FUNCDECL_SYS (getgroups, int, (int n, gid_t *groups));
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_SYS (getgroups, int, (int n, gid_t *groups));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (getgroups);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef getgroups
Packit Service a2489d
# if HAVE_RAW_DECL_GETGROUPS
Packit Service a2489d
_GL_WARN_ON_USE (getgroups, "getgroups is unportable - "
Packit Service a2489d
                 "use gnulib module getgroups for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_GETHOSTNAME@
Packit Service a2489d
/* Return the standard host name of the machine.
Packit Service a2489d
   WARNING! The host name may or may not be fully qualified.
Packit Service a2489d
Packit Service a2489d
   Put up to LEN bytes of the host name into NAME.
Packit Service a2489d
   Null terminate it if the name is shorter than LEN.
Packit Service a2489d
   If the host name is longer than LEN, set errno = EINVAL and return -1.
Packit Service a2489d
   Return 0 if successful, otherwise set errno and return -1.  */
Packit Service a2489d
# if @UNISTD_H_HAVE_WINSOCK2_H@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef gethostname
Packit Service a2489d
#   define gethostname rpl_gethostname
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (gethostname, int, (char *name, size_t len)
Packit Service a2489d
                                    _GL_ARG_NONNULL ((1)));
Packit Service a2489d
_GL_CXXALIAS_RPL (gethostname, int, (char *name, size_t len));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_GETHOSTNAME@
Packit Service a2489d
_GL_FUNCDECL_SYS (gethostname, int, (char *name, size_t len)
Packit Service a2489d
                                    _GL_ARG_NONNULL ((1)));
Packit Service a2489d
#  endif
Packit Service a2489d
/* Need to cast, because on Solaris 10 and OSF/1 5.1 systems, the second
Packit Service a2489d
   parameter is
Packit Service a2489d
                                                      int len.  */
Packit Service a2489d
_GL_CXXALIAS_SYS_CAST (gethostname, int, (char *name, size_t len));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (gethostname);
Packit Service a2489d
#elif @UNISTD_H_HAVE_WINSOCK2_H@
Packit Service a2489d
# undef gethostname
Packit Service a2489d
# define gethostname gethostname_used_without_requesting_gnulib_module_gethostname
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef gethostname
Packit Service a2489d
# if HAVE_RAW_DECL_GETHOSTNAME
Packit Service a2489d
_GL_WARN_ON_USE (gethostname, "gethostname is unportable - "
Packit Service a2489d
                 "use gnulib module gethostname for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_GETLOGIN@
Packit Service a2489d
/* Returns the user's login name, or NULL if it cannot be found.  Upon error,
Packit Service a2489d
   returns NULL with errno set.
Packit Service a2489d
Packit Service a2489d
   See <http://www.opengroup.org/susv3xsh/getlogin.html>.
Packit Service a2489d
Packit Service a2489d
   Most programs don't need to use this function, because the information is
Packit Service a2489d
   available through environment variables:
Packit Service a2489d
     ${LOGNAME-$USER}        on Unix platforms,
Packit Service a2489d
     $USERNAME               on native Windows platforms.
Packit Service a2489d
 */
Packit Service a2489d
# if !@HAVE_DECL_GETLOGIN@
Packit Service a2489d
_GL_FUNCDECL_SYS (getlogin, char *, (void));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIAS_SYS (getlogin, char *, (void));
Packit Service a2489d
_GL_CXXALIASWARN (getlogin);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef getlogin
Packit Service a2489d
# if HAVE_RAW_DECL_GETLOGIN
Packit Service a2489d
_GL_WARN_ON_USE (getlogin, "getlogin is unportable - "
Packit Service a2489d
                 "use gnulib module getlogin for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_GETLOGIN_R@
Packit Service a2489d
/* Copies the user's login name to NAME.
Packit Service a2489d
   The array pointed to by NAME has room for SIZE bytes.
Packit Service a2489d
Packit Service a2489d
   Returns 0 if successful.  Upon error, an error number is returned, or -1 in
Packit Service a2489d
   the case that the login name cannot be found but no specific error is
Packit Service a2489d
   provided (this case is hopefully rare but is left open by the POSIX spec).
Packit Service a2489d
Packit Service a2489d
   See <http://www.opengroup.org/susv3xsh/getlogin.html>.
Packit Service a2489d
Packit Service a2489d
   Most programs don't need to use this function, because the information is
Packit Service a2489d
   available through environment variables:
Packit Service a2489d
     ${LOGNAME-$USER}        on Unix platforms,
Packit Service a2489d
     $USERNAME               on native Windows platforms.
Packit Service a2489d
 */
Packit Service a2489d
# if @REPLACE_GETLOGIN_R@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   define getlogin_r rpl_getlogin_r
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (getlogin_r, int, (char *name, size_t size)
Packit Service a2489d
                                   _GL_ARG_NONNULL ((1)));
Packit Service a2489d
_GL_CXXALIAS_RPL (getlogin_r, int, (char *name, size_t size));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_DECL_GETLOGIN_R@
Packit Service a2489d
_GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size)
Packit Service a2489d
                                   _GL_ARG_NONNULL ((1)));
Packit Service a2489d
#  endif
Packit Service a2489d
/* Need to cast, because on Solaris 10 systems, the second argument is
Packit Service a2489d
                                                     int size.  */
Packit Service a2489d
_GL_CXXALIAS_SYS_CAST (getlogin_r, int, (char *name, size_t size));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (getlogin_r);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef getlogin_r
Packit Service a2489d
# if HAVE_RAW_DECL_GETLOGIN_R
Packit Service a2489d
_GL_WARN_ON_USE (getlogin_r, "getlogin_r is unportable - "
Packit Service a2489d
                 "use gnulib module getlogin_r for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_GETPAGESIZE@
Packit Service a2489d
# if @REPLACE_GETPAGESIZE@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   define getpagesize rpl_getpagesize
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (getpagesize, int, (void));
Packit Service a2489d
_GL_CXXALIAS_RPL (getpagesize, int, (void));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_GETPAGESIZE@
Packit Service a2489d
#   if !defined getpagesize
Packit Service a2489d
/* This is for POSIX systems.  */
Packit Service a2489d
#    if !defined _gl_getpagesize && defined _SC_PAGESIZE
Packit Service a2489d
#     if ! (defined __VMS && __VMS_VER < 70000000)
Packit Service a2489d
#      define _gl_getpagesize() sysconf (_SC_PAGESIZE)
Packit Service a2489d
#     endif
Packit Service a2489d
#    endif
Packit Service a2489d
/* This is for older VMS.  */
Packit Service a2489d
#    if !defined _gl_getpagesize && defined __VMS
Packit Service a2489d
#     ifdef __ALPHA
Packit Service a2489d
#      define _gl_getpagesize() 8192
Packit Service a2489d
#     else
Packit Service a2489d
#      define _gl_getpagesize() 512
Packit Service a2489d
#     endif
Packit Service a2489d
#    endif
Packit Service a2489d
/* This is for BeOS.  */
Packit Service a2489d
#    if !defined _gl_getpagesize && @HAVE_OS_H@
Packit Service a2489d
#     include <OS.h>
Packit Service a2489d
#     if defined B_PAGE_SIZE
Packit Service a2489d
#      define _gl_getpagesize() B_PAGE_SIZE
Packit Service a2489d
#     endif
Packit Service a2489d
#    endif
Packit Service a2489d
/* This is for AmigaOS4.0.  */
Packit Service a2489d
#    if !defined _gl_getpagesize && defined __amigaos4__
Packit Service a2489d
#     define _gl_getpagesize() 2048
Packit Service a2489d
#    endif
Packit Service a2489d
/* This is for older Unix systems.  */
Packit Service a2489d
#    if !defined _gl_getpagesize && @HAVE_SYS_PARAM_H@
Packit Service a2489d
#     include <sys/param.h>
Packit Service a2489d
#     ifdef EXEC_PAGESIZE
Packit Service a2489d
#      define _gl_getpagesize() EXEC_PAGESIZE
Packit Service a2489d
#     else
Packit Service a2489d
#      ifdef NBPG
Packit Service a2489d
#       ifndef CLSIZE
Packit Service a2489d
#        define CLSIZE 1
Packit Service a2489d
#       endif
Packit Service a2489d
#       define _gl_getpagesize() (NBPG * CLSIZE)
Packit Service a2489d
#      else
Packit Service a2489d
#       ifdef NBPC
Packit Service a2489d
#        define _gl_getpagesize() NBPC
Packit Service a2489d
#       endif
Packit Service a2489d
#      endif
Packit Service a2489d
#     endif
Packit Service a2489d
#    endif
Packit Service a2489d
#    if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#     define getpagesize() _gl_getpagesize ()
Packit Service a2489d
#    else
Packit Service a2489d
#     if !GNULIB_defined_getpagesize_function
Packit Service a2489d
_GL_UNISTD_INLINE int
Packit Service a2489d
getpagesize ()
Packit Service a2489d
{
Packit Service a2489d
  return _gl_getpagesize ();
Packit Service a2489d
}
Packit Service a2489d
#      define GNULIB_defined_getpagesize_function 1
Packit Service a2489d
#     endif
Packit Service a2489d
#    endif
Packit Service a2489d
#   endif
Packit Service a2489d
#  endif
Packit Service a2489d
/* Need to cast, because on Cygwin 1.5.x systems, the return type is size_t.  */
Packit Service a2489d
_GL_CXXALIAS_SYS_CAST (getpagesize, int, (void));
Packit Service a2489d
# endif
Packit Service a2489d
# if @HAVE_DECL_GETPAGESIZE@
Packit Service a2489d
_GL_CXXALIASWARN (getpagesize);
Packit Service a2489d
# endif
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef getpagesize
Packit Service a2489d
# if HAVE_RAW_DECL_GETPAGESIZE
Packit Service a2489d
_GL_WARN_ON_USE (getpagesize, "getpagesize is unportable - "
Packit Service a2489d
                 "use gnulib module getpagesize for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_GETUSERSHELL@
Packit Service a2489d
/* Return the next valid login shell on the system, or NULL when the end of
Packit Service a2489d
   the list has been reached.  */
Packit Service a2489d
# if !@HAVE_DECL_GETUSERSHELL@
Packit Service a2489d
_GL_FUNCDECL_SYS (getusershell, char *, (void));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIAS_SYS (getusershell, char *, (void));
Packit Service a2489d
_GL_CXXALIASWARN (getusershell);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef getusershell
Packit Service a2489d
# if HAVE_RAW_DECL_GETUSERSHELL
Packit Service a2489d
_GL_WARN_ON_USE (getusershell, "getusershell is unportable - "
Packit Service a2489d
                 "use gnulib module getusershell for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_GETUSERSHELL@
Packit Service a2489d
/* Rewind to pointer that is advanced at each getusershell() call.  */
Packit Service a2489d
# if !@HAVE_DECL_GETUSERSHELL@
Packit Service a2489d
_GL_FUNCDECL_SYS (setusershell, void, (void));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIAS_SYS (setusershell, void, (void));
Packit Service a2489d
_GL_CXXALIASWARN (setusershell);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef setusershell
Packit Service a2489d
# if HAVE_RAW_DECL_SETUSERSHELL
Packit Service a2489d
_GL_WARN_ON_USE (setusershell, "setusershell is unportable - "
Packit Service a2489d
                 "use gnulib module getusershell for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_GETUSERSHELL@
Packit Service a2489d
/* Free the pointer that is advanced at each getusershell() call and
Packit Service a2489d
   associated resources.  */
Packit Service a2489d
# if !@HAVE_DECL_GETUSERSHELL@
Packit Service a2489d
_GL_FUNCDECL_SYS (endusershell, void, (void));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIAS_SYS (endusershell, void, (void));
Packit Service a2489d
_GL_CXXALIASWARN (endusershell);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef endusershell
Packit Service a2489d
# if HAVE_RAW_DECL_ENDUSERSHELL
Packit Service a2489d
_GL_WARN_ON_USE (endusershell, "endusershell is unportable - "
Packit Service a2489d
                 "use gnulib module getusershell for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_GROUP_MEMBER@
Packit Service a2489d
/* Determine whether group id is in calling user's group list.  */
Packit Service a2489d
# if !@HAVE_GROUP_MEMBER@
Packit Service a2489d
_GL_FUNCDECL_SYS (group_member, int, (gid_t gid));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIAS_SYS (group_member, int, (gid_t gid));
Packit Service a2489d
_GL_CXXALIASWARN (group_member);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef group_member
Packit Service a2489d
# if HAVE_RAW_DECL_GROUP_MEMBER
Packit Service a2489d
_GL_WARN_ON_USE (group_member, "group_member is unportable - "
Packit Service a2489d
                 "use gnulib module group-member for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_ISATTY@
Packit Service a2489d
# if @REPLACE_ISATTY@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef isatty
Packit Service a2489d
#   define isatty rpl_isatty
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (isatty, int, (int fd));
Packit Service a2489d
_GL_CXXALIAS_RPL (isatty, int, (int fd));
Packit Service a2489d
# else
Packit Service a2489d
_GL_CXXALIAS_SYS (isatty, int, (int fd));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (isatty);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef isatty
Packit Service a2489d
# if HAVE_RAW_DECL_ISATTY
Packit Service a2489d
_GL_WARN_ON_USE (isatty, "isatty has portability problems on native Windows - "
Packit Service a2489d
                 "use gnulib module isatty for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_LCHOWN@
Packit Service a2489d
/* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
Packit Service a2489d
   to GID (if GID is not -1).  Do not follow symbolic links.
Packit Service a2489d
   Return 0 if successful, otherwise -1 and errno set.
Packit Service a2489d
   See the POSIX:2008 specification
Packit Service a2489d
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/lchown.html>.  */
Packit Service a2489d
# if @REPLACE_LCHOWN@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef lchown
Packit Service a2489d
#   define lchown rpl_lchown
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (lchown, int, (char const *file, uid_t owner, gid_t group)
Packit Service a2489d
                               _GL_ARG_NONNULL ((1)));
Packit Service a2489d
_GL_CXXALIAS_RPL (lchown, int, (char const *file, uid_t owner, gid_t group));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_LCHOWN@
Packit Service a2489d
_GL_FUNCDECL_SYS (lchown, int, (char const *file, uid_t owner, gid_t group)
Packit Service a2489d
                               _GL_ARG_NONNULL ((1)));
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_SYS (lchown, int, (char const *file, uid_t owner, gid_t group));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (lchown);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef lchown
Packit Service a2489d
# if HAVE_RAW_DECL_LCHOWN
Packit Service a2489d
_GL_WARN_ON_USE (lchown, "lchown is unportable to pre-POSIX.1-2001 systems - "
Packit Service a2489d
                 "use gnulib module lchown for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_LINK@
Packit Service a2489d
/* Create a new hard link for an existing file.
Packit Service a2489d
   Return 0 if successful, otherwise -1 and errno set.
Packit Service a2489d
   See POSIX:2008 specification
Packit Service a2489d
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html>.  */
Packit Service a2489d
# if @REPLACE_LINK@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   define link rpl_link
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (link, int, (const char *path1, const char *path2)
Packit Service a2489d
                             _GL_ARG_NONNULL ((1, 2)));
Packit Service a2489d
_GL_CXXALIAS_RPL (link, int, (const char *path1, const char *path2));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_LINK@
Packit Service a2489d
_GL_FUNCDECL_SYS (link, int, (const char *path1, const char *path2)
Packit Service a2489d
                             _GL_ARG_NONNULL ((1, 2)));
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_SYS (link, int, (const char *path1, const char *path2));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (link);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef link
Packit Service a2489d
# if HAVE_RAW_DECL_LINK
Packit Service a2489d
_GL_WARN_ON_USE (link, "link is unportable - "
Packit Service a2489d
                 "use gnulib module link for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_LINKAT@
Packit Service a2489d
/* Create a new hard link for an existing file, relative to two
Packit Service a2489d
   directories.  FLAG controls whether symlinks are followed.
Packit Service a2489d
   Return 0 if successful, otherwise -1 and errno set.  */
Packit Service a2489d
# if @REPLACE_LINKAT@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef linkat
Packit Service a2489d
#   define linkat rpl_linkat
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (linkat, int,
Packit Service a2489d
                  (int fd1, const char *path1, int fd2, const char *path2,
Packit Service a2489d
                   int flag)
Packit Service a2489d
                  _GL_ARG_NONNULL ((2, 4)));
Packit Service a2489d
_GL_CXXALIAS_RPL (linkat, int,
Packit Service a2489d
                  (int fd1, const char *path1, int fd2, const char *path2,
Packit Service a2489d
                   int flag));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_LINKAT@
Packit Service a2489d
_GL_FUNCDECL_SYS (linkat, int,
Packit Service a2489d
                  (int fd1, const char *path1, int fd2, const char *path2,
Packit Service a2489d
                   int flag)
Packit Service a2489d
                  _GL_ARG_NONNULL ((2, 4)));
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_SYS (linkat, int,
Packit Service a2489d
                  (int fd1, const char *path1, int fd2, const char *path2,
Packit Service a2489d
                   int flag));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (linkat);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef linkat
Packit Service a2489d
# if HAVE_RAW_DECL_LINKAT
Packit Service a2489d
_GL_WARN_ON_USE (linkat, "linkat is unportable - "
Packit Service a2489d
                 "use gnulib module linkat for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_LSEEK@
Packit Service a2489d
/* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END.
Packit Service a2489d
   Return the new offset if successful, otherwise -1 and errno set.
Packit Service a2489d
   See the POSIX:2008 specification
Packit Service a2489d
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html>.  */
Packit Service a2489d
# if @REPLACE_LSEEK@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   define lseek rpl_lseek
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (lseek, off_t, (int fd, off_t offset, int whence));
Packit Service a2489d
_GL_CXXALIAS_RPL (lseek, off_t, (int fd, off_t offset, int whence));
Packit Service a2489d
# else
Packit Service a2489d
_GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (lseek);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef lseek
Packit Service a2489d
# if HAVE_RAW_DECL_LSEEK
Packit Service a2489d
_GL_WARN_ON_USE (lseek, "lseek does not fail with ESPIPE on pipes on some "
Packit Service a2489d
                 "systems - use gnulib module lseek for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_PIPE@
Packit Service a2489d
/* Create a pipe, defaulting to O_BINARY mode.
Packit Service a2489d
   Store the read-end as fd[0] and the write-end as fd[1].
Packit Service a2489d
   Return 0 upon success, or -1 with errno set upon failure.  */
Packit Service a2489d
# if !@HAVE_PIPE@
Packit Service a2489d
_GL_FUNCDECL_SYS (pipe, int, (int fd[2]) _GL_ARG_NONNULL ((1)));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIAS_SYS (pipe, int, (int fd[2]));
Packit Service a2489d
_GL_CXXALIASWARN (pipe);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef pipe
Packit Service a2489d
# if HAVE_RAW_DECL_PIPE
Packit Service a2489d
_GL_WARN_ON_USE (pipe, "pipe is unportable - "
Packit Service a2489d
                 "use gnulib module pipe-posix for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_PIPE2@
Packit Service a2489d
/* Create a pipe, applying the given flags when opening the read-end of the
Packit Service a2489d
   pipe and the write-end of the pipe.
Packit Service a2489d
   The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
Packit Service a2489d
   and O_TEXT, O_BINARY (defined in "binary-io.h").
Packit Service a2489d
   Store the read-end as fd[0] and the write-end as fd[1].
Packit Service a2489d
   Return 0 upon success, or -1 with errno set upon failure.
Packit Service a2489d
   See also the Linux man page at
Packit Service a2489d
   <https://www.kernel.org/doc/man-pages/online/pages/man2/pipe2.2.html>.  */
Packit Service a2489d
# if @HAVE_PIPE2@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   define pipe2 rpl_pipe2
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1)));
Packit Service a2489d
_GL_CXXALIAS_RPL (pipe2, int, (int fd[2], int flags));
Packit Service a2489d
# else
Packit Service a2489d
_GL_FUNCDECL_SYS (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1)));
Packit Service a2489d
_GL_CXXALIAS_SYS (pipe2, int, (int fd[2], int flags));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (pipe2);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef pipe2
Packit Service a2489d
# if HAVE_RAW_DECL_PIPE2
Packit Service a2489d
_GL_WARN_ON_USE (pipe2, "pipe2 is unportable - "
Packit Service a2489d
                 "use gnulib module pipe2 for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_PREAD@
Packit Service a2489d
/* Read at most BUFSIZE bytes from FD into BUF, starting at OFFSET.
Packit Service a2489d
   Return the number of bytes placed into BUF if successful, otherwise
Packit Service a2489d
   set errno and return -1.  0 indicates EOF.
Packit Service a2489d
   See the POSIX:2008 specification
Packit Service a2489d
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/pread.html>.  */
Packit Service a2489d
# if @REPLACE_PREAD@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef pread
Packit Service a2489d
#   define pread rpl_pread
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (pread, ssize_t,
Packit Service a2489d
                  (int fd, void *buf, size_t bufsize, off_t offset)
Packit Service a2489d
                  _GL_ARG_NONNULL ((2)));
Packit Service a2489d
_GL_CXXALIAS_RPL (pread, ssize_t,
Packit Service a2489d
                  (int fd, void *buf, size_t bufsize, off_t offset));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_PREAD@
Packit Service a2489d
_GL_FUNCDECL_SYS (pread, ssize_t,
Packit Service a2489d
                  (int fd, void *buf, size_t bufsize, off_t offset)
Packit Service a2489d
                  _GL_ARG_NONNULL ((2)));
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_SYS (pread, ssize_t,
Packit Service a2489d
                  (int fd, void *buf, size_t bufsize, off_t offset));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (pread);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef pread
Packit Service a2489d
# if HAVE_RAW_DECL_PREAD
Packit Service a2489d
_GL_WARN_ON_USE (pread, "pread is unportable - "
Packit Service a2489d
                 "use gnulib module pread for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_PWRITE@
Packit Service a2489d
/* Write at most BUFSIZE bytes from BUF into FD, starting at OFFSET.
Packit Service a2489d
   Return the number of bytes written if successful, otherwise
Packit Service a2489d
   set errno and return -1.  0 indicates nothing written.  See the
Packit Service a2489d
   POSIX:2008 specification
Packit Service a2489d
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/pwrite.html>.  */
Packit Service a2489d
# if @REPLACE_PWRITE@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef pwrite
Packit Service a2489d
#   define pwrite rpl_pwrite
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (pwrite, ssize_t,
Packit Service a2489d
                  (int fd, const void *buf, size_t bufsize, off_t offset)
Packit Service a2489d
                  _GL_ARG_NONNULL ((2)));
Packit Service a2489d
_GL_CXXALIAS_RPL (pwrite, ssize_t,
Packit Service a2489d
                  (int fd, const void *buf, size_t bufsize, off_t offset));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_PWRITE@
Packit Service a2489d
_GL_FUNCDECL_SYS (pwrite, ssize_t,
Packit Service a2489d
                  (int fd, const void *buf, size_t bufsize, off_t offset)
Packit Service a2489d
                  _GL_ARG_NONNULL ((2)));
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_SYS (pwrite, ssize_t,
Packit Service a2489d
                  (int fd, const void *buf, size_t bufsize, off_t offset));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (pwrite);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef pwrite
Packit Service a2489d
# if HAVE_RAW_DECL_PWRITE
Packit Service a2489d
_GL_WARN_ON_USE (pwrite, "pwrite is unportable - "
Packit Service a2489d
                 "use gnulib module pwrite for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_READ@
Packit Service a2489d
/* Read up to COUNT bytes from file descriptor FD into the buffer starting
Packit Service a2489d
   at BUF.  See the POSIX:2008 specification
Packit Service a2489d
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html>.  */
Packit Service a2489d
# if @REPLACE_READ@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef read
Packit Service a2489d
#   define read rpl_read
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (read, ssize_t, (int fd, void *buf, size_t count)
Packit Service a2489d
                                 _GL_ARG_NONNULL ((2)));
Packit Service a2489d
_GL_CXXALIAS_RPL (read, ssize_t, (int fd, void *buf, size_t count));
Packit Service a2489d
# else
Packit Service a2489d
/* Need to cast, because on mingw, the third parameter is
Packit Service a2489d
                                                          unsigned int count
Packit Service a2489d
   and the return type is 'int'.  */
Packit Service a2489d
_GL_CXXALIAS_SYS_CAST (read, ssize_t, (int fd, void *buf, size_t count));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (read);
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_READLINK@
Packit Service a2489d
/* Read the contents of the symbolic link FILE and place the first BUFSIZE
Packit Service a2489d
   bytes of it into BUF.  Return the number of bytes placed into BUF if
Packit Service a2489d
   successful, otherwise -1 and errno set.
Packit Service a2489d
   See the POSIX:2008 specification
Packit Service a2489d
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html>.  */
Packit Service a2489d
# if @REPLACE_READLINK@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   define readlink rpl_readlink
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (readlink, ssize_t,
Packit Service a2489d
                  (const char *file, char *buf, size_t bufsize)
Packit Service a2489d
                  _GL_ARG_NONNULL ((1, 2)));
Packit Service a2489d
_GL_CXXALIAS_RPL (readlink, ssize_t,
Packit Service a2489d
                  (const char *file, char *buf, size_t bufsize));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_READLINK@
Packit Service a2489d
_GL_FUNCDECL_SYS (readlink, ssize_t,
Packit Service a2489d
                  (const char *file, char *buf, size_t bufsize)
Packit Service a2489d
                  _GL_ARG_NONNULL ((1, 2)));
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_SYS (readlink, ssize_t,
Packit Service a2489d
                  (const char *file, char *buf, size_t bufsize));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (readlink);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef readlink
Packit Service a2489d
# if HAVE_RAW_DECL_READLINK
Packit Service a2489d
_GL_WARN_ON_USE (readlink, "readlink is unportable - "
Packit Service a2489d
                 "use gnulib module readlink for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_READLINKAT@
Packit Service a2489d
# if @REPLACE_READLINKAT@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   define readlinkat rpl_readlinkat
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (readlinkat, ssize_t,
Packit Service a2489d
                  (int fd, char const *file, char *buf, size_t len)
Packit Service a2489d
                  _GL_ARG_NONNULL ((2, 3)));
Packit Service a2489d
_GL_CXXALIAS_RPL (readlinkat, ssize_t,
Packit Service a2489d
                  (int fd, char const *file, char *buf, size_t len));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_READLINKAT@
Packit Service a2489d
_GL_FUNCDECL_SYS (readlinkat, ssize_t,
Packit Service a2489d
                  (int fd, char const *file, char *buf, size_t len)
Packit Service a2489d
                  _GL_ARG_NONNULL ((2, 3)));
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_SYS (readlinkat, ssize_t,
Packit Service a2489d
                  (int fd, char const *file, char *buf, size_t len));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (readlinkat);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef readlinkat
Packit Service a2489d
# if HAVE_RAW_DECL_READLINKAT
Packit Service a2489d
_GL_WARN_ON_USE (readlinkat, "readlinkat is not portable - "
Packit Service a2489d
                 "use gnulib module readlinkat for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_RMDIR@
Packit Service a2489d
/* Remove the directory DIR.  */
Packit Service a2489d
# if @REPLACE_RMDIR@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   define rmdir rpl_rmdir
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (rmdir, int, (char const *name) _GL_ARG_NONNULL ((1)));
Packit Service a2489d
_GL_CXXALIAS_RPL (rmdir, int, (char const *name));
Packit Service a2489d
# else
Packit Service a2489d
_GL_CXXALIAS_SYS (rmdir, int, (char const *name));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (rmdir);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef rmdir
Packit Service a2489d
# if HAVE_RAW_DECL_RMDIR
Packit Service a2489d
_GL_WARN_ON_USE (rmdir, "rmdir is unportable - "
Packit Service a2489d
                 "use gnulib module rmdir for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_SETHOSTNAME@
Packit Service a2489d
/* Set the host name of the machine.
Packit Service a2489d
   The host name may or may not be fully qualified.
Packit Service a2489d
Packit Service a2489d
   Put LEN bytes of NAME into the host name.
Packit Service a2489d
   Return 0 if successful, otherwise, set errno and return -1.
Packit Service a2489d
Packit Service a2489d
   Platforms with no ability to set the hostname return -1 and set
Packit Service a2489d
   errno = ENOSYS.  */
Packit Service a2489d
# if !@HAVE_SETHOSTNAME@ || !@HAVE_DECL_SETHOSTNAME@
Packit Service a2489d
_GL_FUNCDECL_SYS (sethostname, int, (const char *name, size_t len)
Packit Service a2489d
                                    _GL_ARG_NONNULL ((1)));
Packit Service a2489d
# endif
Packit Service a2489d
/* Need to cast, because on Solaris 11 2011-10, Mac OS X 10.5, IRIX 6.5
Packit Service a2489d
   and FreeBSD 6.4 the second parameter is int.  On Solaris 11
Packit Service a2489d
   2011-10, the first parameter is not const.  */
Packit Service a2489d
_GL_CXXALIAS_SYS_CAST (sethostname, int, (const char *name, size_t len));
Packit Service a2489d
_GL_CXXALIASWARN (sethostname);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef sethostname
Packit Service a2489d
# if HAVE_RAW_DECL_SETHOSTNAME
Packit Service a2489d
_GL_WARN_ON_USE (sethostname, "sethostname is unportable - "
Packit Service a2489d
                 "use gnulib module sethostname for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_SLEEP@
Packit Service a2489d
/* Pause the execution of the current thread for N seconds.
Packit Service a2489d
   Returns the number of seconds left to sleep.
Packit Service a2489d
   See the POSIX:2008 specification
Packit Service a2489d
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/sleep.html>.  */
Packit Service a2489d
# if @REPLACE_SLEEP@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef sleep
Packit Service a2489d
#   define sleep rpl_sleep
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (sleep, unsigned int, (unsigned int n));
Packit Service a2489d
_GL_CXXALIAS_RPL (sleep, unsigned int, (unsigned int n));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_SLEEP@
Packit Service a2489d
_GL_FUNCDECL_SYS (sleep, unsigned int, (unsigned int n));
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_SYS (sleep, unsigned int, (unsigned int n));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (sleep);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef sleep
Packit Service a2489d
# if HAVE_RAW_DECL_SLEEP
Packit Service a2489d
_GL_WARN_ON_USE (sleep, "sleep is unportable - "
Packit Service a2489d
                 "use gnulib module sleep for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_SYMLINK@
Packit Service a2489d
# if @REPLACE_SYMLINK@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef symlink
Packit Service a2489d
#   define symlink rpl_symlink
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (symlink, int, (char const *contents, char const *file)
Packit Service a2489d
                                _GL_ARG_NONNULL ((1, 2)));
Packit Service a2489d
_GL_CXXALIAS_RPL (symlink, int, (char const *contents, char const *file));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_SYMLINK@
Packit Service a2489d
_GL_FUNCDECL_SYS (symlink, int, (char const *contents, char const *file)
Packit Service a2489d
                                _GL_ARG_NONNULL ((1, 2)));
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_SYS (symlink, int, (char const *contents, char const *file));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (symlink);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef symlink
Packit Service a2489d
# if HAVE_RAW_DECL_SYMLINK
Packit Service a2489d
_GL_WARN_ON_USE (symlink, "symlink is not portable - "
Packit Service a2489d
                 "use gnulib module symlink for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_SYMLINKAT@
Packit Service a2489d
# if @REPLACE_SYMLINKAT@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef symlinkat
Packit Service a2489d
#   define symlinkat rpl_symlinkat
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (symlinkat, int,
Packit Service a2489d
                  (char const *contents, int fd, char const *file)
Packit Service a2489d
                  _GL_ARG_NONNULL ((1, 3)));
Packit Service a2489d
_GL_CXXALIAS_RPL (symlinkat, int,
Packit Service a2489d
                  (char const *contents, int fd, char const *file));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_SYMLINKAT@
Packit Service a2489d
_GL_FUNCDECL_SYS (symlinkat, int,
Packit Service a2489d
                  (char const *contents, int fd, char const *file)
Packit Service a2489d
                  _GL_ARG_NONNULL ((1, 3)));
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_SYS (symlinkat, int,
Packit Service a2489d
                  (char const *contents, int fd, char const *file));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (symlinkat);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef symlinkat
Packit Service a2489d
# if HAVE_RAW_DECL_SYMLINKAT
Packit Service a2489d
_GL_WARN_ON_USE (symlinkat, "symlinkat is not portable - "
Packit Service a2489d
                 "use gnulib module symlinkat for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_TRUNCATE@
Packit Service a2489d
/* Change the size of the file designated by FILENAME to become equal to LENGTH.
Packit Service a2489d
   Return 0 if successful, otherwise -1 and errno set.
Packit Service a2489d
   See the POSIX:2008 specification
Packit Service a2489d
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/truncate.html>.  */
Packit Service a2489d
# if @REPLACE_TRUNCATE@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef truncate
Packit Service a2489d
#   define truncate rpl_truncate
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (truncate, int, (const char *filename, off_t length)
Packit Service a2489d
                                 _GL_ARG_NONNULL ((1)));
Packit Service a2489d
_GL_CXXALIAS_RPL (truncate, int, (const char *filename, off_t length));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_DECL_TRUNCATE@
Packit Service a2489d
_GL_FUNCDECL_SYS (truncate, int, (const char *filename, off_t length)
Packit Service a2489d
                                 _GL_ARG_NONNULL ((1)));
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_SYS (truncate, int, (const char *filename, off_t length));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (truncate);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef truncate
Packit Service a2489d
# if HAVE_RAW_DECL_TRUNCATE
Packit Service a2489d
_GL_WARN_ON_USE (truncate, "truncate is unportable - "
Packit Service a2489d
                 "use gnulib module truncate for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_TTYNAME_R@
Packit Service a2489d
/* Store at most BUFLEN characters of the pathname of the terminal FD is
Packit Service a2489d
   open on in BUF.  Return 0 on success, otherwise an error number.  */
Packit Service a2489d
# if @REPLACE_TTYNAME_R@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef ttyname_r
Packit Service a2489d
#   define ttyname_r rpl_ttyname_r
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (ttyname_r, int,
Packit Service a2489d
                  (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
Packit Service a2489d
_GL_CXXALIAS_RPL (ttyname_r, int,
Packit Service a2489d
                  (int fd, char *buf, size_t buflen));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_DECL_TTYNAME_R@
Packit Service a2489d
_GL_FUNCDECL_SYS (ttyname_r, int,
Packit Service a2489d
                  (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_SYS (ttyname_r, int,
Packit Service a2489d
                  (int fd, char *buf, size_t buflen));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (ttyname_r);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef ttyname_r
Packit Service a2489d
# if HAVE_RAW_DECL_TTYNAME_R
Packit Service a2489d
_GL_WARN_ON_USE (ttyname_r, "ttyname_r is not portable - "
Packit Service a2489d
                 "use gnulib module ttyname_r for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_UNLINK@
Packit Service a2489d
# if @REPLACE_UNLINK@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef unlink
Packit Service a2489d
#   define unlink rpl_unlink
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (unlink, int, (char const *file) _GL_ARG_NONNULL ((1)));
Packit Service a2489d
_GL_CXXALIAS_RPL (unlink, int, (char const *file));
Packit Service a2489d
# else
Packit Service a2489d
_GL_CXXALIAS_SYS (unlink, int, (char const *file));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (unlink);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef unlink
Packit Service a2489d
# if HAVE_RAW_DECL_UNLINK
Packit Service a2489d
_GL_WARN_ON_USE (unlink, "unlink is not portable - "
Packit Service a2489d
                 "use gnulib module unlink for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_UNLINKAT@
Packit Service a2489d
# if @REPLACE_UNLINKAT@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef unlinkat
Packit Service a2489d
#   define unlinkat rpl_unlinkat
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (unlinkat, int, (int fd, char const *file, int flag)
Packit Service a2489d
                                 _GL_ARG_NONNULL ((2)));
Packit Service a2489d
_GL_CXXALIAS_RPL (unlinkat, int, (int fd, char const *file, int flag));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_UNLINKAT@
Packit Service a2489d
_GL_FUNCDECL_SYS (unlinkat, int, (int fd, char const *file, int flag)
Packit Service a2489d
                                 _GL_ARG_NONNULL ((2)));
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_SYS (unlinkat, int, (int fd, char const *file, int flag));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (unlinkat);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef unlinkat
Packit Service a2489d
# if HAVE_RAW_DECL_UNLINKAT
Packit Service a2489d
_GL_WARN_ON_USE (unlinkat, "unlinkat is not portable - "
Packit Service a2489d
                 "use gnulib module openat for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_USLEEP@
Packit Service a2489d
/* Pause the execution of the current thread for N microseconds.
Packit Service a2489d
   Returns 0 on completion, or -1 on range error.
Packit Service a2489d
   See the POSIX:2001 specification
Packit Service a2489d
   <http://www.opengroup.org/susv3xsh/usleep.html>.  */
Packit Service a2489d
# if @REPLACE_USLEEP@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef usleep
Packit Service a2489d
#   define usleep rpl_usleep
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (usleep, int, (useconds_t n));
Packit Service a2489d
_GL_CXXALIAS_RPL (usleep, int, (useconds_t n));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_USLEEP@
Packit Service a2489d
_GL_FUNCDECL_SYS (usleep, int, (useconds_t n));
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_SYS (usleep, int, (useconds_t n));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (usleep);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef usleep
Packit Service a2489d
# if HAVE_RAW_DECL_USLEEP
Packit Service a2489d
_GL_WARN_ON_USE (usleep, "usleep is unportable - "
Packit Service a2489d
                 "use gnulib module usleep for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_WRITE@
Packit Service a2489d
/* Write up to COUNT bytes starting at BUF to file descriptor FD.
Packit Service a2489d
   See the POSIX:2008 specification
Packit Service a2489d
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html>.  */
Packit Service a2489d
# if @REPLACE_WRITE@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef write
Packit Service a2489d
#   define write rpl_write
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (write, ssize_t, (int fd, const void *buf, size_t count)
Packit Service a2489d
                                  _GL_ARG_NONNULL ((2)));
Packit Service a2489d
_GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count));
Packit Service a2489d
# else
Packit Service a2489d
/* Need to cast, because on mingw, the third parameter is
Packit Service a2489d
                                                             unsigned int count
Packit Service a2489d
   and the return type is 'int'.  */
Packit Service a2489d
_GL_CXXALIAS_SYS_CAST (write, ssize_t, (int fd, const void *buf, size_t count));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (write);
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
_GL_INLINE_HEADER_END
Packit Service a2489d
Packit Service a2489d
#endif /* _@GUARD_PREFIX@_UNISTD_H */
Packit Service a2489d
#endif /* _GL_INCLUDING_UNISTD_H */
Packit Service a2489d
#endif /* _@GUARD_PREFIX@_UNISTD_H */