Blame lib/unistd.in.h

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