Back to index

nagios-plugins  1.4.16
unistd.in.h
Go to the documentation of this file.
00001 /* Substitute for and wrapper around <unistd.h>.
00002    Copyright (C) 2003-2010 Free Software Foundation, Inc.
00003 
00004    This program is free software; you can redistribute it and/or modify
00005    it under the terms of the GNU General Public License as published by
00006    the Free Software Foundation; either version 3, or (at your option)
00007    any later version.
00008 
00009    This program is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012    GNU General Public License for more details.
00013 
00014    You should have received a copy of the GNU General Public License
00015    along with this program; if not, write to the Free Software Foundation,
00016    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
00017 
00018 #if __GNUC__ >= 3
00019 @PRAGMA_SYSTEM_HEADER@
00020 #endif
00021 
00022 /* Special invocation convention:
00023    - On mingw, several headers, including <winsock2.h>, include <unistd.h>,
00024      but we need to ensure that both the system <unistd.h> and <winsock2.h>
00025      are completely included before we replace gethostname.  */
00026 #if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \
00027   && !defined _GL_WINSOCK2_H_WITNESS && defined _WINSOCK2_H
00028 /* <unistd.h> is being indirectly included for the first time from
00029    <winsock2.h>; avoid declaring any overrides.  */
00030 # if @HAVE_UNISTD_H@
00031 #  @INCLUDE_NEXT@ @NEXT_UNISTD_H@
00032 # else
00033 #  error unexpected; report this to bug-gnulib@gnu.org
00034 # endif
00035 # define _GL_WINSOCK2_H_WITNESS
00036 
00037 /* Normal invocation.  */
00038 #elif !defined _GL_UNISTD_H
00039 
00040 /* The include_next requires a split double-inclusion guard.  */
00041 #if @HAVE_UNISTD_H@
00042 # @INCLUDE_NEXT@ @NEXT_UNISTD_H@
00043 #endif
00044 
00045 /* Get all possible declarations of gethostname().  */
00046 #if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \
00047   && !defined _GL_INCLUDING_WINSOCK2_H
00048 # define _GL_INCLUDING_WINSOCK2_H
00049 # include <winsock2.h>
00050 # undef _GL_INCLUDING_WINSOCK2_H
00051 #endif
00052 
00053 #if !defined _GL_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H
00054 #define _GL_UNISTD_H
00055 
00056 /* NetBSD 5.0 mis-defines NULL.  Also get size_t.  */
00057 #include <stddef.h>
00058 
00059 /* mingw doesn't define the SEEK_* or *_FILENO macros in <unistd.h>.  */
00060 /* Cygwin 1.7.1 declares symlinkat in <stdio.h>, not in <unistd.h>.  */
00061 /* But avoid namespace pollution on glibc systems.  */
00062 #if (!(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) \
00063      || (@GNULIB_SYMLINKAT@ || defined GNULIB_POSIXCHECK)) \
00064     && ! defined __GLIBC__
00065 # include <stdio.h>
00066 #endif
00067 
00068 /* Cygwin 1.7.1 declares unlinkat in <fcntl.h>, not in <unistd.h>.  */
00069 /* But avoid namespace pollution on glibc systems.  */
00070 #if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__
00071 # include <fcntl.h>
00072 #endif
00073 
00074 /* mingw fails to declare _exit in <unistd.h>.  */
00075 /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>.  */
00076 /* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>.  */
00077 /* But avoid namespace pollution on glibc systems.  */
00078 #ifndef __GLIBC__
00079 # include <stdlib.h>
00080 #endif
00081 
00082 /* mingw declares getcwd in <io.h>, not in <unistd.h>.  */
00083 #if ((@GNULIB_GETCWD@ || defined GNULIB_POSIXCHECK) \
00084      && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
00085 # include <io.h>
00086 #endif
00087 
00088 #if (@GNULIB_WRITE@ || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \
00089      || @GNULIB_PREAD@ || @GNULIB_PWRITE@ || defined GNULIB_POSIXCHECK)
00090 /* Get ssize_t.  */
00091 # include <sys/types.h>
00092 #endif
00093 
00094 /* Get getopt(), optarg, optind, opterr, optopt.
00095    But avoid namespace pollution on glibc systems.  */
00096 #if @GNULIB_UNISTD_H_GETOPT@ && !defined __GLIBC__ && !defined _GL_SYSTEM_GETOPT
00097 # include <getopt.h>
00098 #endif
00099 
00100 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
00101 
00102 /* The definition of _GL_ARG_NONNULL is copied here.  */
00103 
00104 /* The definition of _GL_WARN_ON_USE is copied here.  */
00105 
00106 
00107 #if @GNULIB_GETHOSTNAME@
00108 /* Get all possible declarations of gethostname().  */
00109 # if @UNISTD_H_HAVE_WINSOCK2_H@
00110 #  if !defined _GL_SYS_SOCKET_H
00111 #   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00112 #    undef socket
00113 #    define socket              socket_used_without_including_sys_socket_h
00114 #    undef connect
00115 #    define connect             connect_used_without_including_sys_socket_h
00116 #    undef accept
00117 #    define accept              accept_used_without_including_sys_socket_h
00118 #    undef bind
00119 #    define bind                bind_used_without_including_sys_socket_h
00120 #    undef getpeername
00121 #    define getpeername         getpeername_used_without_including_sys_socket_h
00122 #    undef getsockname
00123 #    define getsockname         getsockname_used_without_including_sys_socket_h
00124 #    undef getsockopt
00125 #    define getsockopt          getsockopt_used_without_including_sys_socket_h
00126 #    undef listen
00127 #    define listen              listen_used_without_including_sys_socket_h
00128 #    undef recv
00129 #    define recv                recv_used_without_including_sys_socket_h
00130 #    undef send
00131 #    define send                send_used_without_including_sys_socket_h
00132 #    undef recvfrom
00133 #    define recvfrom            recvfrom_used_without_including_sys_socket_h
00134 #    undef sendto
00135 #    define sendto              sendto_used_without_including_sys_socket_h
00136 #    undef setsockopt
00137 #    define setsockopt          setsockopt_used_without_including_sys_socket_h
00138 #    undef shutdown
00139 #    define shutdown            shutdown_used_without_including_sys_socket_h
00140 #   else
00141      _GL_WARN_ON_USE (socket,
00142                       "socket() used without including <sys/socket.h>");
00143      _GL_WARN_ON_USE (connect,
00144                       "connect() used without including <sys/socket.h>");
00145      _GL_WARN_ON_USE (accept,
00146                       "accept() used without including <sys/socket.h>");
00147      _GL_WARN_ON_USE (bind,
00148                       "bind() used without including <sys/socket.h>");
00149      _GL_WARN_ON_USE (getpeername,
00150                       "getpeername() used without including <sys/socket.h>");
00151      _GL_WARN_ON_USE (getsockname,
00152                       "getsockname() used without including <sys/socket.h>");
00153      _GL_WARN_ON_USE (getsockopt,
00154                       "getsockopt() used without including <sys/socket.h>");
00155      _GL_WARN_ON_USE (listen,
00156                       "listen() used without including <sys/socket.h>");
00157      _GL_WARN_ON_USE (recv,
00158                       "recv() used without including <sys/socket.h>");
00159      _GL_WARN_ON_USE (send,
00160                       "send() used without including <sys/socket.h>");
00161      _GL_WARN_ON_USE (recvfrom,
00162                       "recvfrom() used without including <sys/socket.h>");
00163      _GL_WARN_ON_USE (sendto,
00164                       "sendto() used without including <sys/socket.h>");
00165      _GL_WARN_ON_USE (setsockopt,
00166                       "setsockopt() used without including <sys/socket.h>");
00167      _GL_WARN_ON_USE (shutdown,
00168                       "shutdown() used without including <sys/socket.h>");
00169 #   endif
00170 #  endif
00171 #  if !defined _GL_SYS_SELECT_H
00172 #   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00173 #    undef select
00174 #    define select              select_used_without_including_sys_select_h
00175 #   else
00176      _GL_WARN_ON_USE (select,
00177                       "select() used without including <sys/select.h>");
00178 #   endif
00179 #  endif
00180 # endif
00181 #endif
00182 
00183 
00184 /* OS/2 EMX lacks these macros.  */
00185 #ifndef STDIN_FILENO
00186 # define STDIN_FILENO 0
00187 #endif
00188 #ifndef STDOUT_FILENO
00189 # define STDOUT_FILENO 1
00190 #endif
00191 #ifndef STDERR_FILENO
00192 # define STDERR_FILENO 2
00193 #endif
00194 
00195 /* Ensure *_OK macros exist.  */
00196 #ifndef F_OK
00197 # define F_OK 0
00198 # define X_OK 1
00199 # define W_OK 2
00200 # define R_OK 4
00201 #endif
00202 
00203 
00204 /* Declare overridden functions.  */
00205 
00206 
00207 #if defined GNULIB_POSIXCHECK
00208 /* The access() function is a security risk.  */
00209 _GL_WARN_ON_USE (access, "the access function is a security risk - "
00210                  "use the gnulib module faccessat instead");
00211 #endif
00212 
00213 
00214 #if @GNULIB_CHOWN@
00215 /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
00216    to GID (if GID is not -1).  Follow symbolic links.
00217    Return 0 if successful, otherwise -1 and errno set.
00218    See the POSIX:2001 specification
00219    <http://www.opengroup.org/susv3xsh/chown.html>.  */
00220 # if @REPLACE_CHOWN@
00221 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00222 #   undef chown
00223 #   define chown rpl_chown
00224 #  endif
00225 _GL_FUNCDECL_RPL (chown, int, (const char *file, uid_t uid, gid_t gid)
00226                               _GL_ARG_NONNULL ((1)));
00227 _GL_CXXALIAS_RPL (chown, int, (const char *file, uid_t uid, gid_t gid));
00228 # else
00229 #  if !@HAVE_CHOWN@
00230 _GL_FUNCDECL_SYS (chown, int, (const char *file, uid_t uid, gid_t gid)
00231                               _GL_ARG_NONNULL ((1)));
00232 #  endif
00233 _GL_CXXALIAS_SYS (chown, int, (const char *file, uid_t uid, gid_t gid));
00234 # endif
00235 _GL_CXXALIASWARN (chown);
00236 #elif defined GNULIB_POSIXCHECK
00237 # undef chown
00238 # if HAVE_RAW_DECL_CHOWN
00239 _GL_WARN_ON_USE (chown, "chown fails to follow symlinks on some systems and "
00240                  "doesn't treat a uid or gid of -1 on some systems - "
00241                  "use gnulib module chown for portability");
00242 # endif
00243 #endif
00244 
00245 
00246 #if @GNULIB_CLOSE@
00247 # if @REPLACE_CLOSE@
00248 /* Automatically included by modules that need a replacement for close.  */
00249 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00250 #   undef close
00251 #   define close rpl_close
00252 #  endif
00253 _GL_FUNCDECL_RPL (close, int, (int fd));
00254 _GL_CXXALIAS_RPL (close, int, (int fd));
00255 # else
00256 _GL_CXXALIAS_SYS (close, int, (int fd));
00257 # endif
00258 _GL_CXXALIASWARN (close);
00259 #elif @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
00260 # undef close
00261 # define close close_used_without_requesting_gnulib_module_close
00262 #elif defined GNULIB_POSIXCHECK
00263 # undef close
00264 /* Assume close is always declared.  */
00265 _GL_WARN_ON_USE (close, "close does not portably work on sockets - "
00266                  "use gnulib module close for portability");
00267 #endif
00268 
00269 
00270 #if @REPLACE_DUP@
00271 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00272 #  define dup rpl_dup
00273 # endif
00274 _GL_FUNCDECL_RPL (dup, int, (int oldfd));
00275 _GL_CXXALIAS_RPL (dup, int, (int oldfd));
00276 #else
00277 _GL_CXXALIAS_SYS (dup, int, (int oldfd));
00278 #endif
00279 _GL_CXXALIASWARN (dup);
00280 
00281 
00282 #if @GNULIB_DUP2@
00283 /* Copy the file descriptor OLDFD into file descriptor NEWFD.  Do nothing if
00284    NEWFD = OLDFD, otherwise close NEWFD first if it is open.
00285    Return newfd if successful, otherwise -1 and errno set.
00286    See the POSIX:2001 specification
00287    <http://www.opengroup.org/susv3xsh/dup2.html>.  */
00288 # if @REPLACE_DUP2@
00289 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00290 #   define dup2 rpl_dup2
00291 #  endif
00292 _GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd));
00293 _GL_CXXALIAS_RPL (dup2, int, (int oldfd, int newfd));
00294 # else
00295 #  if !@HAVE_DUP2@
00296 _GL_FUNCDECL_SYS (dup2, int, (int oldfd, int newfd));
00297 #  endif
00298 _GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd));
00299 # endif
00300 _GL_CXXALIASWARN (dup2);
00301 #elif defined GNULIB_POSIXCHECK
00302 # undef dup2
00303 # if HAVE_RAW_DECL_DUP2
00304 _GL_WARN_ON_USE (dup2, "dup2 is unportable - "
00305                  "use gnulib module dup2 for portability");
00306 # endif
00307 #endif
00308 
00309 
00310 #if @GNULIB_DUP3@
00311 /* Copy the file descriptor OLDFD into file descriptor NEWFD, with the
00312    specified flags.
00313    The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
00314    and O_TEXT, O_BINARY (defined in "binary-io.h").
00315    Close NEWFD first if it is open.
00316    Return newfd if successful, otherwise -1 and errno set.
00317    See the Linux man page at
00318    <http://www.kernel.org/doc/man-pages/online/pages/man2/dup3.2.html>.  */
00319 # if @HAVE_DUP3@
00320 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00321 #   define dup3 rpl_dup3
00322 #  endif
00323 _GL_FUNCDECL_RPL (dup3, int, (int oldfd, int newfd, int flags));
00324 _GL_CXXALIAS_RPL (dup3, int, (int oldfd, int newfd, int flags));
00325 # else
00326 _GL_FUNCDECL_SYS (dup3, int, (int oldfd, int newfd, int flags));
00327 _GL_CXXALIAS_SYS (dup3, int, (int oldfd, int newfd, int flags));
00328 # endif
00329 _GL_CXXALIASWARN (dup3);
00330 #elif defined GNULIB_POSIXCHECK
00331 # undef dup3
00332 # if HAVE_RAW_DECL_DUP3
00333 _GL_WARN_ON_USE (dup3, "dup3 is unportable - "
00334                  "use gnulib module dup3 for portability");
00335 # endif
00336 #endif
00337 
00338 
00339 #if @GNULIB_ENVIRON@
00340 # if !@HAVE_DECL_ENVIRON@
00341 /* Set of environment variables and values.  An array of strings of the form
00342    "VARIABLE=VALUE", terminated with a NULL.  */
00343 #  if defined __APPLE__ && defined __MACH__
00344 #   include <crt_externs.h>
00345 #   define environ (*_NSGetEnviron ())
00346 #  else
00347 #   ifdef __cplusplus
00348 extern "C" {
00349 #   endif
00350 extern char **environ;
00351 #   ifdef __cplusplus
00352 }
00353 #   endif
00354 #  endif
00355 # endif
00356 #elif defined GNULIB_POSIXCHECK
00357 # if HAVE_RAW_DECL_ENVIRON
00358 static inline char ***
00359 rpl_environ (void)
00360 {
00361   return &environ;
00362 }
00363 _GL_WARN_ON_USE (rpl_environ, "environ is unportable - "
00364                  "use gnulib module environ for portability");
00365 #  undef environ
00366 #  define environ (*rpl_environ ())
00367 # endif
00368 #endif
00369 
00370 
00371 #if @GNULIB_EUIDACCESS@
00372 /* Like access(), except that it uses the effective user id and group id of
00373    the current process.  */
00374 # if !@HAVE_EUIDACCESS@
00375 _GL_FUNCDECL_SYS (euidaccess, int, (const char *filename, int mode)
00376                                    _GL_ARG_NONNULL ((1)));
00377 # endif
00378 _GL_CXXALIAS_SYS (euidaccess, int, (const char *filename, int mode));
00379 _GL_CXXALIASWARN (euidaccess);
00380 # if defined GNULIB_POSIXCHECK
00381 /* Like access(), this function is a security risk.  */
00382 _GL_WARN_ON_USE (euidaccess, "the euidaccess function is a security risk - "
00383                  "use the gnulib module faccessat instead");
00384 # endif
00385 #elif defined GNULIB_POSIXCHECK
00386 # undef euidaccess
00387 # if HAVE_RAW_DECL_EUIDACCESS
00388 _GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - "
00389                  "use gnulib module euidaccess for portability");
00390 # endif
00391 #endif
00392 
00393 
00394 #if @GNULIB_FACCESSAT@
00395 # if !@HAVE_FACCESSAT@
00396 _GL_FUNCDECL_SYS (faccessat, int,
00397                   (int fd, char const *file, int mode, int flag)
00398                   _GL_ARG_NONNULL ((2)));
00399 # endif
00400 _GL_CXXALIAS_SYS (faccessat, int,
00401                   (int fd, char const *file, int mode, int flag));
00402 _GL_CXXALIASWARN (faccessat);
00403 #elif defined GNULIB_POSIXCHECK
00404 # undef faccessat
00405 # if HAVE_RAW_DECL_FACCESSAT
00406 _GL_WARN_ON_USE (faccessat, "faccessat is not portable - "
00407                  "use gnulib module faccessat for portability");
00408 # endif
00409 #endif
00410 
00411 
00412 #if @GNULIB_FCHDIR@
00413 /* Change the process' current working directory to the directory on which
00414    the given file descriptor is open.
00415    Return 0 if successful, otherwise -1 and errno set.
00416    See the POSIX:2001 specification
00417    <http://www.opengroup.org/susv3xsh/fchdir.html>.  */
00418 # if ! @HAVE_FCHDIR@
00419 _GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/));
00420 
00421 /* Gnulib internal hooks needed to maintain the fchdir metadata.  */
00422 _GL_EXTERN_C int _gl_register_fd (int fd, const char *filename)
00423      _GL_ARG_NONNULL ((2));
00424 _GL_EXTERN_C void _gl_unregister_fd (int fd);
00425 _GL_EXTERN_C int _gl_register_dup (int oldfd, int newfd);
00426 _GL_EXTERN_C const char *_gl_directory_name (int fd);
00427 
00428 # endif
00429 _GL_CXXALIAS_SYS (fchdir, int, (int /*fd*/));
00430 _GL_CXXALIASWARN (fchdir);
00431 #elif defined GNULIB_POSIXCHECK
00432 # undef fchdir
00433 # if HAVE_RAW_DECL_FCHDIR
00434 _GL_WARN_ON_USE (fchdir, "fchdir is unportable - "
00435                  "use gnulib module fchdir for portability");
00436 # endif
00437 #endif
00438 
00439 
00440 #if @GNULIB_FCHOWNAT@
00441 # if @REPLACE_FCHOWNAT@
00442 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00443 #   undef fchownat
00444 #   define fchownat rpl_fchownat
00445 #  endif
00446 _GL_FUNCDECL_RPL (fchownat, int, (int fd, char const *file,
00447                                   uid_t owner, gid_t group, int flag)
00448                                  _GL_ARG_NONNULL ((2)));
00449 _GL_CXXALIAS_RPL (fchownat, int, (int fd, char const *file,
00450                                   uid_t owner, gid_t group, int flag));
00451 # else
00452 #  if !@HAVE_FCHOWNAT@
00453 _GL_FUNCDECL_SYS (fchownat, int, (int fd, char const *file,
00454                                   uid_t owner, gid_t group, int flag)
00455                                  _GL_ARG_NONNULL ((2)));
00456 #  endif
00457 _GL_CXXALIAS_SYS (fchownat, int, (int fd, char const *file,
00458                                   uid_t owner, gid_t group, int flag));
00459 # endif
00460 _GL_CXXALIASWARN (fchownat);
00461 #elif defined GNULIB_POSIXCHECK
00462 # undef fchownat
00463 # if HAVE_RAW_DECL_FCHOWNAT
00464 _GL_WARN_ON_USE (fchownat, "fchownat is not portable - "
00465                  "use gnulib module openat for portability");
00466 # endif
00467 #endif
00468 
00469 
00470 #if @GNULIB_FSYNC@
00471 /* Synchronize changes to a file.
00472    Return 0 if successful, otherwise -1 and errno set.
00473    See POSIX:2001 specification
00474    <http://www.opengroup.org/susv3xsh/fsync.html>.  */
00475 # if !@HAVE_FSYNC@
00476 _GL_FUNCDECL_SYS (fsync, int, (int fd));
00477 # endif
00478 _GL_CXXALIAS_SYS (fsync, int, (int fd));
00479 _GL_CXXALIASWARN (fsync);
00480 #elif defined GNULIB_POSIXCHECK
00481 # undef fsync
00482 # if HAVE_RAW_DECL_FSYNC
00483 _GL_WARN_ON_USE (fsync, "fsync is unportable - "
00484                  "use gnulib module fsync for portability");
00485 # endif
00486 #endif
00487 
00488 
00489 #if @GNULIB_FTRUNCATE@
00490 /* Change the size of the file to which FD is opened to become equal to LENGTH.
00491    Return 0 if successful, otherwise -1 and errno set.
00492    See the POSIX:2001 specification
00493    <http://www.opengroup.org/susv3xsh/ftruncate.html>.  */
00494 # if !@HAVE_FTRUNCATE@
00495 _GL_FUNCDECL_SYS (ftruncate, int, (int fd, off_t length));
00496 # endif
00497 _GL_CXXALIAS_SYS (ftruncate, int, (int fd, off_t length));
00498 _GL_CXXALIASWARN (ftruncate);
00499 #elif defined GNULIB_POSIXCHECK
00500 # undef ftruncate
00501 # if HAVE_RAW_DECL_FTRUNCATE
00502 _GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - "
00503                  "use gnulib module ftruncate for portability");
00504 # endif
00505 #endif
00506 
00507 
00508 #if @GNULIB_GETCWD@
00509 /* Get the name of the current working directory, and put it in SIZE bytes
00510    of BUF.
00511    Return BUF if successful, or NULL if the directory couldn't be determined
00512    or SIZE was too small.
00513    See the POSIX:2001 specification
00514    <http://www.opengroup.org/susv3xsh/getcwd.html>.
00515    Additionally, the gnulib module 'getcwd' guarantees the following GNU
00516    extension: If BUF is NULL, an array is allocated with 'malloc'; the array
00517    is SIZE bytes long, unless SIZE == 0, in which case it is as big as
00518    necessary.  */
00519 # if @REPLACE_GETCWD@
00520 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00521 #   define getcwd rpl_getcwd
00522 #  endif
00523 _GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size));
00524 _GL_CXXALIAS_RPL (getcwd, char *, (char *buf, size_t size));
00525 # else
00526 /* Need to cast, because on mingw, the second parameter is
00527                                                    int size.  */
00528 _GL_CXXALIAS_SYS_CAST (getcwd, char *, (char *buf, size_t size));
00529 # endif
00530 _GL_CXXALIASWARN (getcwd);
00531 #elif defined GNULIB_POSIXCHECK
00532 # undef getcwd
00533 # if HAVE_RAW_DECL_GETCWD
00534 _GL_WARN_ON_USE (getcwd, "getcwd is unportable - "
00535                  "use gnulib module getcwd for portability");
00536 # endif
00537 #endif
00538 
00539 
00540 #if @GNULIB_GETDOMAINNAME@
00541 /* Return the NIS domain name of the machine.
00542    WARNING! The NIS domain name is unrelated to the fully qualified host name
00543             of the machine.  It is also unrelated to email addresses.
00544    WARNING! The NIS domain name is usually the empty string or "(none)" when
00545             not using NIS.
00546 
00547    Put up to LEN bytes of the NIS domain name into NAME.
00548    Null terminate it if the name is shorter than LEN.
00549    If the NIS domain name is longer than LEN, set errno = EINVAL and return -1.
00550    Return 0 if successful, otherwise set errno and return -1.  */
00551 # if !@HAVE_GETDOMAINNAME@
00552 _GL_FUNCDECL_SYS (getdomainname, int, (char *name, size_t len)
00553                                       _GL_ARG_NONNULL ((1)));
00554 # endif
00555 /* Need to cast, because on MacOS X 10.5 systems, the second parameter is
00556                                                         int len.  */
00557 _GL_CXXALIAS_SYS_CAST (getdomainname, int, (char *name, size_t len));
00558 _GL_CXXALIASWARN (getdomainname);
00559 #elif defined GNULIB_POSIXCHECK
00560 # undef getdomainname
00561 # if HAVE_RAW_DECL_GETDOMAINNAME
00562 _GL_WARN_ON_USE (getdomainname, "getdomainname is unportable - "
00563                  "use gnulib module getdomainname for portability");
00564 # endif
00565 #endif
00566 
00567 
00568 #if @GNULIB_GETDTABLESIZE@
00569 /* Return the maximum number of file descriptors in the current process.
00570    In POSIX, this is same as sysconf (_SC_OPEN_MAX).  */
00571 # if !@HAVE_GETDTABLESIZE@
00572 _GL_FUNCDECL_SYS (getdtablesize, int, (void));
00573 # endif
00574 _GL_CXXALIAS_SYS (getdtablesize, int, (void));
00575 _GL_CXXALIASWARN (getdtablesize);
00576 #elif defined GNULIB_POSIXCHECK
00577 # undef getdtablesize
00578 # if HAVE_RAW_DECL_GETDTABLESIZE
00579 _GL_WARN_ON_USE (getdtablesize, "getdtablesize is unportable - "
00580                  "use gnulib module getdtablesize for portability");
00581 # endif
00582 #endif
00583 
00584 
00585 #if @GNULIB_GETGROUPS@
00586 /* Return the supplemental groups that the current process belongs to.
00587    It is unspecified whether the effective group id is in the list.
00588    If N is 0, return the group count; otherwise, N describes how many
00589    entries are available in GROUPS.  Return -1 and set errno if N is
00590    not 0 and not large enough.  Fails with ENOSYS on some systems.  */
00591 # if @REPLACE_GETGROUPS@
00592 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00593 #   undef getgroups
00594 #   define getgroups rpl_getgroups
00595 #  endif
00596 _GL_FUNCDECL_RPL (getgroups, int, (int n, gid_t *groups));
00597 _GL_CXXALIAS_RPL (getgroups, int, (int n, gid_t *groups));
00598 # else
00599 #  if !@HAVE_GETGROUPS@
00600 _GL_FUNCDECL_SYS (getgroups, int, (int n, gid_t *groups));
00601 #  endif
00602 _GL_CXXALIAS_SYS (getgroups, int, (int n, gid_t *groups));
00603 # endif
00604 _GL_CXXALIASWARN (getgroups);
00605 #elif defined GNULIB_POSIXCHECK
00606 # undef getgroups
00607 # if HAVE_RAW_DECL_GETGROUPS
00608 _GL_WARN_ON_USE (getgroups, "getgroups is unportable - "
00609                  "use gnulib module getgroups for portability");
00610 # endif
00611 #endif
00612 
00613 
00614 #if @GNULIB_GETHOSTNAME@
00615 /* Return the standard host name of the machine.
00616    WARNING! The host name may or may not be fully qualified.
00617 
00618    Put up to LEN bytes of the host name into NAME.
00619    Null terminate it if the name is shorter than LEN.
00620    If the host name is longer than LEN, set errno = EINVAL and return -1.
00621    Return 0 if successful, otherwise set errno and return -1.  */
00622 # if @UNISTD_H_HAVE_WINSOCK2_H@
00623 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00624 #   undef gethostname
00625 #   define gethostname rpl_gethostname
00626 #  endif
00627 _GL_FUNCDECL_RPL (gethostname, int, (char *name, size_t len)
00628                                     _GL_ARG_NONNULL ((1)));
00629 _GL_CXXALIAS_RPL (gethostname, int, (char *name, size_t len));
00630 # else
00631 #  if !@HAVE_GETHOSTNAME@
00632 _GL_FUNCDECL_SYS (gethostname, int, (char *name, size_t len)
00633                                     _GL_ARG_NONNULL ((1)));
00634 #  endif
00635 /* Need to cast, because on Solaris 10 systems, the second parameter is
00636                                                       int len.  */
00637 _GL_CXXALIAS_SYS_CAST (gethostname, int, (char *name, size_t len));
00638 # endif
00639 _GL_CXXALIASWARN (gethostname);
00640 #elif @UNISTD_H_HAVE_WINSOCK2_H@
00641 # undef gethostname
00642 # define gethostname gethostname_used_without_requesting_gnulib_module_gethostname
00643 #elif defined GNULIB_POSIXCHECK
00644 # undef gethostname
00645 # if HAVE_RAW_DECL_GETHOSTNAME
00646 _GL_WARN_ON_USE (gethostname, "gethostname is unportable - "
00647                  "use gnulib module gethostname for portability");
00648 # endif
00649 #endif
00650 
00651 
00652 #if @GNULIB_GETLOGIN@
00653 /* Returns the user's login name, or NULL if it cannot be found.  Upon error,
00654    returns NULL with errno set.
00655 
00656    See <http://www.opengroup.org/susv3xsh/getlogin.html>.
00657 
00658    Most programs don't need to use this function, because the information is
00659    available through environment variables:
00660      ${LOGNAME-$USER}        on Unix platforms,
00661      $USERNAME               on native Windows platforms.
00662  */
00663 # if !@HAVE_GETLOGIN@
00664 _GL_FUNCDECL_SYS (getlogin, char *, (void));
00665 # endif
00666 _GL_CXXALIAS_SYS (getlogin, char *, (void));
00667 _GL_CXXALIASWARN (getlogin);
00668 #elif defined GNULIB_POSIXCHECK
00669 # undef getlogin
00670 # if HAVE_RAW_DECL_GETLOGIN
00671 _GL_WARN_ON_USE (getlogin, "getlogin is unportable - "
00672                  "use gnulib module getlogin for portability");
00673 # endif
00674 #endif
00675 
00676 
00677 #if @GNULIB_GETLOGIN_R@
00678 /* Copies the user's login name to NAME.
00679    The array pointed to by NAME has room for SIZE bytes.
00680 
00681    Returns 0 if successful.  Upon error, an error number is returned, or -1 in
00682    the case that the login name cannot be found but no specific error is
00683    provided (this case is hopefully rare but is left open by the POSIX spec).
00684 
00685    See <http://www.opengroup.org/susv3xsh/getlogin.html>.
00686 
00687    Most programs don't need to use this function, because the information is
00688    available through environment variables:
00689      ${LOGNAME-$USER}        on Unix platforms,
00690      $USERNAME               on native Windows platforms.
00691  */
00692 # if !@HAVE_DECL_GETLOGIN_R@
00693 _GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size)
00694                                    _GL_ARG_NONNULL ((1)));
00695 # endif
00696 /* Need to cast, because on Solaris 10 systems, the second argument is
00697                                                      int size.  */
00698 _GL_CXXALIAS_SYS_CAST (getlogin_r, int, (char *name, size_t size));
00699 _GL_CXXALIASWARN (getlogin_r);
00700 #elif defined GNULIB_POSIXCHECK
00701 # undef getlogin_r
00702 # if HAVE_RAW_DECL_GETLOGIN_R
00703 _GL_WARN_ON_USE (getlogin_r, "getlogin_r is unportable - "
00704                  "use gnulib module getlogin_r for portability");
00705 # endif
00706 #endif
00707 
00708 
00709 #if @GNULIB_GETPAGESIZE@
00710 # if @REPLACE_GETPAGESIZE@
00711 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00712 #   define getpagesize rpl_getpagesize
00713 #  endif
00714 _GL_FUNCDECL_RPL (getpagesize, int, (void));
00715 _GL_CXXALIAS_RPL (getpagesize, int, (void));
00716 # else
00717 #  if !@HAVE_GETPAGESIZE@
00718 #   if !defined getpagesize
00719 /* This is for POSIX systems.  */
00720 #    if !defined _gl_getpagesize && defined _SC_PAGESIZE
00721 #     if ! (defined __VMS && __VMS_VER < 70000000)
00722 #      define _gl_getpagesize() sysconf (_SC_PAGESIZE)
00723 #     endif
00724 #    endif
00725 /* This is for older VMS.  */
00726 #    if !defined _gl_getpagesize && defined __VMS
00727 #     ifdef __ALPHA
00728 #      define _gl_getpagesize() 8192
00729 #     else
00730 #      define _gl_getpagesize() 512
00731 #     endif
00732 #    endif
00733 /* This is for BeOS.  */
00734 #    if !defined _gl_getpagesize && @HAVE_OS_H@
00735 #     include <OS.h>
00736 #     if defined B_PAGE_SIZE
00737 #      define _gl_getpagesize() B_PAGE_SIZE
00738 #     endif
00739 #    endif
00740 /* This is for AmigaOS4.0.  */
00741 #    if !defined _gl_getpagesize && defined __amigaos4__
00742 #     define _gl_getpagesize() 2048
00743 #    endif
00744 /* This is for older Unix systems.  */
00745 #    if !defined _gl_getpagesize && @HAVE_SYS_PARAM_H@
00746 #     include <sys/param.h>
00747 #     ifdef EXEC_PAGESIZE
00748 #      define _gl_getpagesize() EXEC_PAGESIZE
00749 #     else
00750 #      ifdef NBPG
00751 #       ifndef CLSIZE
00752 #        define CLSIZE 1
00753 #       endif
00754 #       define _gl_getpagesize() (NBPG * CLSIZE)
00755 #      else
00756 #       ifdef NBPC
00757 #        define _gl_getpagesize() NBPC
00758 #       endif
00759 #      endif
00760 #     endif
00761 #    endif
00762 #    if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00763 #     define getpagesize() _gl_getpagesize ()
00764 #    else
00765 static inline int
00766 getpagesize ()
00767 {
00768   return _gl_getpagesize ();
00769 }
00770 #    endif
00771 #   endif
00772 #  endif
00773 /* Need to cast, because on Cygwin 1.5.x systems, the return type is size_t.  */
00774 _GL_CXXALIAS_SYS_CAST (getpagesize, int, (void));
00775 # endif
00776 # if @HAVE_DECL_GETPAGESIZE@
00777 _GL_CXXALIASWARN (getpagesize);
00778 # endif
00779 #elif defined GNULIB_POSIXCHECK
00780 # undef getpagesize
00781 # if HAVE_RAW_DECL_GETPAGESIZE
00782 _GL_WARN_ON_USE (getpagesize, "getpagesize is unportable - "
00783                  "use gnulib module getpagesize for portability");
00784 # endif
00785 #endif
00786 
00787 
00788 #if @GNULIB_GETUSERSHELL@
00789 /* Return the next valid login shell on the system, or NULL when the end of
00790    the list has been reached.  */
00791 # if !@HAVE_DECL_GETUSERSHELL@
00792 _GL_FUNCDECL_SYS (getusershell, char *, (void));
00793 # endif
00794 _GL_CXXALIAS_SYS (getusershell, char *, (void));
00795 _GL_CXXALIASWARN (getusershell);
00796 #elif defined GNULIB_POSIXCHECK
00797 # undef getusershell
00798 # if HAVE_RAW_DECL_GETUSERSHELL
00799 _GL_WARN_ON_USE (getusershell, "getusershell is unportable - "
00800                  "use gnulib module getusershell for portability");
00801 # endif
00802 #endif
00803 
00804 #if @GNULIB_GETUSERSHELL@
00805 /* Rewind to pointer that is advanced at each getusershell() call.  */
00806 # if !@HAVE_DECL_GETUSERSHELL@
00807 _GL_FUNCDECL_SYS (setusershell, void, (void));
00808 # endif
00809 _GL_CXXALIAS_SYS (setusershell, void, (void));
00810 _GL_CXXALIASWARN (setusershell);
00811 #elif defined GNULIB_POSIXCHECK
00812 # undef setusershell
00813 # if HAVE_RAW_DECL_SETUSERSHELL
00814 _GL_WARN_ON_USE (setusershell, "setusershell is unportable - "
00815                  "use gnulib module getusershell for portability");
00816 # endif
00817 #endif
00818 
00819 #if @GNULIB_GETUSERSHELL@
00820 /* Free the pointer that is advanced at each getusershell() call and
00821    associated resources.  */
00822 # if !@HAVE_DECL_GETUSERSHELL@
00823 _GL_FUNCDECL_SYS (endusershell, void, (void));
00824 # endif
00825 _GL_CXXALIAS_SYS (endusershell, void, (void));
00826 _GL_CXXALIASWARN (endusershell);
00827 #elif defined GNULIB_POSIXCHECK
00828 # undef endusershell
00829 # if HAVE_RAW_DECL_ENDUSERSHELL
00830 _GL_WARN_ON_USE (endusershell, "endusershell is unportable - "
00831                  "use gnulib module getusershell for portability");
00832 # endif
00833 #endif
00834 
00835 
00836 #if @GNULIB_LCHOWN@
00837 /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
00838    to GID (if GID is not -1).  Do not follow symbolic links.
00839    Return 0 if successful, otherwise -1 and errno set.
00840    See the POSIX:2001 specification
00841    <http://www.opengroup.org/susv3xsh/lchown.html>.  */
00842 # if @REPLACE_LCHOWN@
00843 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00844 #   undef lchown
00845 #   define lchown rpl_lchown
00846 #  endif
00847 _GL_FUNCDECL_RPL (lchown, int, (char const *file, uid_t owner, gid_t group)
00848                                _GL_ARG_NONNULL ((1)));
00849 _GL_CXXALIAS_RPL (lchown, int, (char const *file, uid_t owner, gid_t group));
00850 # else
00851 #  if !@HAVE_LCHOWN@
00852 _GL_FUNCDECL_SYS (lchown, int, (char const *file, uid_t owner, gid_t group)
00853                                _GL_ARG_NONNULL ((1)));
00854 #  endif
00855 _GL_CXXALIAS_SYS (lchown, int, (char const *file, uid_t owner, gid_t group));
00856 # endif
00857 _GL_CXXALIASWARN (lchown);
00858 #elif defined GNULIB_POSIXCHECK
00859 # undef lchown
00860 # if HAVE_RAW_DECL_LCHOWN
00861 _GL_WARN_ON_USE (lchown, "lchown is unportable to pre-POSIX.1-2001 systems - "
00862                  "use gnulib module lchown for portability");
00863 # endif
00864 #endif
00865 
00866 
00867 #if @GNULIB_LINK@
00868 /* Create a new hard link for an existing file.
00869    Return 0 if successful, otherwise -1 and errno set.
00870    See POSIX:2001 specification
00871    <http://www.opengroup.org/susv3xsh/link.html>.  */
00872 # if @REPLACE_LINK@
00873 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00874 #   define link rpl_link
00875 #  endif
00876 _GL_FUNCDECL_RPL (link, int, (const char *path1, const char *path2)
00877                              _GL_ARG_NONNULL ((1, 2)));
00878 _GL_CXXALIAS_RPL (link, int, (const char *path1, const char *path2));
00879 # else
00880 #  if !@HAVE_LINK@
00881 _GL_FUNCDECL_SYS (link, int, (const char *path1, const char *path2)
00882                              _GL_ARG_NONNULL ((1, 2)));
00883 #  endif
00884 _GL_CXXALIAS_SYS (link, int, (const char *path1, const char *path2));
00885 # endif
00886 _GL_CXXALIASWARN (link);
00887 #elif defined GNULIB_POSIXCHECK
00888 # undef link
00889 # if HAVE_RAW_DECL_LINK
00890 _GL_WARN_ON_USE (link, "link is unportable - "
00891                  "use gnulib module link for portability");
00892 # endif
00893 #endif
00894 
00895 
00896 #if @GNULIB_LINKAT@
00897 /* Create a new hard link for an existing file, relative to two
00898    directories.  FLAG controls whether symlinks are followed.
00899    Return 0 if successful, otherwise -1 and errno set.  */
00900 # if @REPLACE_LINKAT@
00901 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00902 #   undef linkat
00903 #   define linkat rpl_linkat
00904 #  endif
00905 _GL_FUNCDECL_RPL (linkat, int,
00906                   (int fd1, const char *path1, int fd2, const char *path2,
00907                    int flag)
00908                   _GL_ARG_NONNULL ((2, 4)));
00909 _GL_CXXALIAS_RPL (linkat, int,
00910                   (int fd1, const char *path1, int fd2, const char *path2,
00911                    int flag));
00912 # else
00913 #  if !@HAVE_LINKAT@
00914 _GL_FUNCDECL_SYS (linkat, int,
00915                   (int fd1, const char *path1, int fd2, const char *path2,
00916                    int flag)
00917                   _GL_ARG_NONNULL ((2, 4)));
00918 #  endif
00919 _GL_CXXALIAS_SYS (linkat, int,
00920                   (int fd1, const char *path1, int fd2, const char *path2,
00921                    int flag));
00922 # endif
00923 _GL_CXXALIASWARN (linkat);
00924 #elif defined GNULIB_POSIXCHECK
00925 # undef linkat
00926 # if HAVE_RAW_DECL_LINKAT
00927 _GL_WARN_ON_USE (linkat, "linkat is unportable - "
00928                  "use gnulib module linkat for portability");
00929 # endif
00930 #endif
00931 
00932 
00933 #if @GNULIB_LSEEK@
00934 /* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END.
00935    Return the new offset if successful, otherwise -1 and errno set.
00936    See the POSIX:2001 specification
00937    <http://www.opengroup.org/susv3xsh/lseek.html>.  */
00938 # if @REPLACE_LSEEK@
00939 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00940 #   define lseek rpl_lseek
00941 #  endif
00942 _GL_FUNCDECL_RPL (lseek, off_t, (int fd, off_t offset, int whence));
00943 _GL_CXXALIAS_RPL (lseek, off_t, (int fd, off_t offset, int whence));
00944 # else
00945 _GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence));
00946 # endif
00947 _GL_CXXALIASWARN (lseek);
00948 #elif defined GNULIB_POSIXCHECK
00949 # undef lseek
00950 # if HAVE_RAW_DECL_LSEEK
00951 _GL_WARN_ON_USE (lseek, "lseek does not fail with ESPIPE on pipes on some "
00952                  "systems - use gnulib module lseek for portability");
00953 # endif
00954 #endif
00955 
00956 
00957 #if @GNULIB_PIPE2@
00958 /* Create a pipe, applying the given flags when opening the read-end of the
00959    pipe and the write-end of the pipe.
00960    The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
00961    and O_TEXT, O_BINARY (defined in "binary-io.h").
00962    Store the read-end as fd[0] and the write-end as fd[1].
00963    Return 0 upon success, or -1 with errno set upon failure.
00964    See also the Linux man page at
00965    <http://www.kernel.org/doc/man-pages/online/pages/man2/pipe2.2.html>.  */
00966 # if @HAVE_PIPE2@
00967 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00968 #   define pipe2 rpl_pipe2
00969 #  endif
00970 _GL_FUNCDECL_RPL (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1)));
00971 _GL_CXXALIAS_RPL (pipe2, int, (int fd[2], int flags));
00972 # else
00973 _GL_FUNCDECL_SYS (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1)));
00974 _GL_CXXALIAS_SYS (pipe2, int, (int fd[2], int flags));
00975 # endif
00976 _GL_CXXALIASWARN (pipe2);
00977 #elif defined GNULIB_POSIXCHECK
00978 # undef pipe2
00979 # if HAVE_RAW_DECL_PIPE2
00980 _GL_WARN_ON_USE (pipe2, "pipe2 is unportable - "
00981                  "use gnulib module pipe2 for portability");
00982 # endif
00983 #endif
00984 
00985 
00986 #if @GNULIB_PREAD@
00987 /* Read at most BUFSIZE bytes from FD into BUF, starting at OFFSET.
00988    Return the number of bytes placed into BUF if successful, otherwise
00989    set errno and return -1.  0 indicates EOF.  See the POSIX:2001
00990    specification <http://www.opengroup.org/susv3xsh/pread.html>.  */
00991 # if @REPLACE_PREAD@
00992 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00993 #   define pread rpl_pread
00994 #  endif
00995 _GL_FUNCDECL_RPL (pread, ssize_t,
00996                   (int fd, void *buf, size_t bufsize, off_t offset)
00997                   _GL_ARG_NONNULL ((2)));
00998 _GL_CXXALIAS_RPL (pread, ssize_t,
00999                   (int fd, void *buf, size_t bufsize, off_t offset));
01000 # else
01001 #  if !@HAVE_PREAD@
01002 _GL_FUNCDECL_SYS (pread, ssize_t,
01003                   (int fd, void *buf, size_t bufsize, off_t offset)
01004                   _GL_ARG_NONNULL ((2)));
01005 #  endif
01006 _GL_CXXALIAS_SYS (pread, ssize_t,
01007                   (int fd, void *buf, size_t bufsize, off_t offset));
01008 # endif
01009 _GL_CXXALIASWARN (pread);
01010 #elif defined GNULIB_POSIXCHECK
01011 # undef pread
01012 # if HAVE_RAW_DECL_PREAD
01013 _GL_WARN_ON_USE (pread, "pread is unportable - "
01014                  "use gnulib module pread for portability");
01015 # endif
01016 #endif
01017 
01018 
01019 #if @GNULIB_PWRITE@
01020 /* Write at most BUFSIZE bytes from BUF into FD, starting at OFFSET.
01021    Return the number of bytes written if successful, otherwise
01022    set errno and return -1.  0 indicates nothing written.  See the
01023    POSIX:2001 specification
01024    <http://www.opengroup.org/susv3xsh/pwrite.html>.  */
01025 # if @REPLACE_PWRITE@
01026 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
01027 #   define pwrite rpl_pwrite
01028 #  endif
01029 _GL_FUNCDECL_RPL (pwrite, ssize_t,
01030                   (int fd, const void *buf, size_t bufsize, off_t offset)
01031                   _GL_ARG_NONNULL ((2)));
01032 _GL_CXXALIAS_RPL (pwrite, ssize_t,
01033                   (int fd, const void *buf, size_t bufsize, off_t offset));
01034 # else
01035 #  if !@HAVE_PWRITE@
01036 _GL_FUNCDECL_SYS (pwrite, ssize_t,
01037                   (int fd, const void *buf, size_t bufsize, off_t offset)
01038                   _GL_ARG_NONNULL ((2)));
01039 #  endif
01040 _GL_CXXALIAS_SYS (pwrite, ssize_t,
01041                   (int fd, const void *buf, size_t bufsize, off_t offset));
01042 # endif
01043 _GL_CXXALIASWARN (pwrite);
01044 #elif defined GNULIB_POSIXCHECK
01045 # undef pwrite
01046 # if HAVE_RAW_DECL_PWRITE
01047 _GL_WARN_ON_USE (pwrite, "pwrite is unportable - "
01048                  "use gnulib module pwrite for portability");
01049 # endif
01050 #endif
01051 
01052 
01053 #if @GNULIB_READLINK@
01054 /* Read the contents of the symbolic link FILE and place the first BUFSIZE
01055    bytes of it into BUF.  Return the number of bytes placed into BUF if
01056    successful, otherwise -1 and errno set.
01057    See the POSIX:2001 specification
01058    <http://www.opengroup.org/susv3xsh/readlink.html>.  */
01059 # if @REPLACE_READLINK@
01060 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
01061 #   define readlink rpl_readlink
01062 #  endif
01063 _GL_FUNCDECL_RPL (readlink, ssize_t,
01064                   (const char *file, char *buf, size_t bufsize)
01065                   _GL_ARG_NONNULL ((1, 2)));
01066 _GL_CXXALIAS_RPL (readlink, ssize_t,
01067                   (const char *file, char *buf, size_t bufsize));
01068 # else
01069 #  if !@HAVE_READLINK@
01070 _GL_FUNCDECL_SYS (readlink, ssize_t,
01071                   (const char *file, char *buf, size_t bufsize)
01072                   _GL_ARG_NONNULL ((1, 2)));
01073 #  endif
01074 _GL_CXXALIAS_SYS (readlink, ssize_t,
01075                   (const char *file, char *buf, size_t bufsize));
01076 # endif
01077 _GL_CXXALIASWARN (readlink);
01078 #elif defined GNULIB_POSIXCHECK
01079 # undef readlink
01080 # if HAVE_RAW_DECL_READLINK
01081 _GL_WARN_ON_USE (readlink, "readlink is unportable - "
01082                  "use gnulib module readlink for portability");
01083 # endif
01084 #endif
01085 
01086 
01087 #if @GNULIB_READLINKAT@
01088 # if !@HAVE_READLINKAT@
01089 _GL_FUNCDECL_SYS (readlinkat, ssize_t,
01090                   (int fd, char const *file, char *buf, size_t len)
01091                   _GL_ARG_NONNULL ((2, 3)));
01092 # endif
01093 _GL_CXXALIAS_SYS (readlinkat, ssize_t,
01094                   (int fd, char const *file, char *buf, size_t len));
01095 _GL_CXXALIASWARN (readlinkat);
01096 #elif defined GNULIB_POSIXCHECK
01097 # undef readlinkat
01098 # if HAVE_RAW_DECL_READLINKAT
01099 _GL_WARN_ON_USE (readlinkat, "readlinkat is not portable - "
01100                  "use gnulib module symlinkat for portability");
01101 # endif
01102 #endif
01103 
01104 
01105 #if @GNULIB_RMDIR@
01106 /* Remove the directory DIR.  */
01107 # if @REPLACE_RMDIR@
01108 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
01109 #   define rmdir rpl_rmdir
01110 #  endif
01111 _GL_FUNCDECL_RPL (rmdir, int, (char const *name) _GL_ARG_NONNULL ((1)));
01112 _GL_CXXALIAS_RPL (rmdir, int, (char const *name));
01113 # else
01114 _GL_CXXALIAS_SYS (rmdir, int, (char const *name));
01115 # endif
01116 _GL_CXXALIASWARN (rmdir);
01117 #elif defined GNULIB_POSIXCHECK
01118 # undef rmdir
01119 # if HAVE_RAW_DECL_RMDIR
01120 _GL_WARN_ON_USE (rmdir, "rmdir is unportable - "
01121                  "use gnulib module rmdir for portability");
01122 # endif
01123 #endif
01124 
01125 
01126 #if @GNULIB_SLEEP@
01127 /* Pause the execution of the current thread for N seconds.
01128    Returns the number of seconds left to sleep.
01129    See the POSIX:2001 specification
01130    <http://www.opengroup.org/susv3xsh/sleep.html>.  */
01131 # if @REPLACE_SLEEP@
01132 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
01133 #   undef sleep
01134 #   define sleep rpl_sleep
01135 #  endif
01136 _GL_FUNCDECL_RPL (sleep, unsigned int, (unsigned int n));
01137 _GL_CXXALIAS_RPL (sleep, unsigned int, (unsigned int n));
01138 # else
01139 #  if !@HAVE_SLEEP@
01140 _GL_FUNCDECL_SYS (sleep, unsigned int, (unsigned int n));
01141 #  endif
01142 _GL_CXXALIAS_SYS (sleep, unsigned int, (unsigned int n));
01143 # endif
01144 _GL_CXXALIASWARN (sleep);
01145 #elif defined GNULIB_POSIXCHECK
01146 # undef sleep
01147 # if HAVE_RAW_DECL_SLEEP
01148 _GL_WARN_ON_USE (sleep, "sleep is unportable - "
01149                  "use gnulib module sleep for portability");
01150 # endif
01151 #endif
01152 
01153 
01154 #if @GNULIB_SYMLINK@
01155 # if @REPLACE_SYMLINK@
01156 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
01157 #   undef symlink
01158 #   define symlink rpl_symlink
01159 #  endif
01160 _GL_FUNCDECL_RPL (symlink, int, (char const *contents, char const *file)
01161                                 _GL_ARG_NONNULL ((1, 2)));
01162 _GL_CXXALIAS_RPL (symlink, int, (char const *contents, char const *file));
01163 # else
01164 #  if !@HAVE_SYMLINK@
01165 _GL_FUNCDECL_SYS (symlink, int, (char const *contents, char const *file)
01166                                 _GL_ARG_NONNULL ((1, 2)));
01167 #  endif
01168 _GL_CXXALIAS_SYS (symlink, int, (char const *contents, char const *file));
01169 # endif
01170 _GL_CXXALIASWARN (symlink);
01171 #elif defined GNULIB_POSIXCHECK
01172 # undef symlink
01173 # if HAVE_RAW_DECL_SYMLINK
01174 _GL_WARN_ON_USE (symlink, "symlink is not portable - "
01175                  "use gnulib module symlink for portability");
01176 # endif
01177 #endif
01178 
01179 
01180 #if @GNULIB_SYMLINKAT@
01181 # if !@HAVE_SYMLINKAT@
01182 _GL_FUNCDECL_SYS (symlinkat, int,
01183                   (char const *contents, int fd, char const *file)
01184                   _GL_ARG_NONNULL ((1, 3)));
01185 # endif
01186 _GL_CXXALIAS_SYS (symlinkat, int,
01187                   (char const *contents, int fd, char const *file));
01188 _GL_CXXALIASWARN (symlinkat);
01189 #elif defined GNULIB_POSIXCHECK
01190 # undef symlinkat
01191 # if HAVE_RAW_DECL_SYMLINKAT
01192 _GL_WARN_ON_USE (symlinkat, "symlinkat is not portable - "
01193                  "use gnulib module symlinkat for portability");
01194 # endif
01195 #endif
01196 
01197 
01198 #if @GNULIB_TTYNAME_R@
01199 /* Store at most BUFLEN characters of the pathname of the terminal FD is
01200    open on in BUF.  Return 0 on success, otherwise an error number.  */
01201 # if @REPLACE_TTYNAME_R@
01202 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
01203 #   undef ttyname_r
01204 #   define ttyname_r rpl_ttyname_r
01205 #  endif
01206 _GL_FUNCDECL_RPL (ttyname_r, int,
01207                   (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
01208 _GL_CXXALIAS_RPL (ttyname_r, int,
01209                   (int fd, char *buf, size_t buflen));
01210 # else
01211 #  if !@HAVE_TTYNAME_R@
01212 _GL_FUNCDECL_SYS (ttyname_r, int,
01213                   (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
01214 #  endif
01215 _GL_CXXALIAS_SYS (ttyname_r, int,
01216                   (int fd, char *buf, size_t buflen));
01217 # endif
01218 _GL_CXXALIASWARN (ttyname_r);
01219 #elif defined GNULIB_POSIXCHECK
01220 # undef ttyname_r
01221 # if HAVE_RAW_DECL_TTYNAME_R
01222 _GL_WARN_ON_USE (ttyname_r, "ttyname_r is not portable - "
01223                  "use gnulib module ttyname_r for portability");
01224 # endif
01225 #endif
01226 
01227 
01228 #if @GNULIB_UNLINK@
01229 # if @REPLACE_UNLINK@
01230 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
01231 #   undef unlink
01232 #   define unlink rpl_unlink
01233 #  endif
01234 _GL_FUNCDECL_RPL (unlink, int, (char const *file) _GL_ARG_NONNULL ((1)));
01235 _GL_CXXALIAS_RPL (unlink, int, (char const *file));
01236 # else
01237 _GL_CXXALIAS_SYS (unlink, int, (char const *file));
01238 # endif
01239 _GL_CXXALIASWARN (unlink);
01240 #elif defined GNULIB_POSIXCHECK
01241 # undef unlink
01242 # if HAVE_RAW_DECL_UNLINK
01243 _GL_WARN_ON_USE (unlink, "unlink is not portable - "
01244                  "use gnulib module unlink for portability");
01245 # endif
01246 #endif
01247 
01248 
01249 #if @GNULIB_UNLINKAT@
01250 # if @REPLACE_UNLINKAT@
01251 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
01252 #   undef unlinkat
01253 #   define unlinkat rpl_unlinkat
01254 #  endif
01255 _GL_FUNCDECL_RPL (unlinkat, int, (int fd, char const *file, int flag)
01256                                  _GL_ARG_NONNULL ((2)));
01257 _GL_CXXALIAS_RPL (unlinkat, int, (int fd, char const *file, int flag));
01258 # else
01259 #  if !@HAVE_UNLINKAT@
01260 _GL_FUNCDECL_SYS (unlinkat, int, (int fd, char const *file, int flag)
01261                                  _GL_ARG_NONNULL ((2)));
01262 #  endif
01263 _GL_CXXALIAS_SYS (unlinkat, int, (int fd, char const *file, int flag));
01264 # endif
01265 _GL_CXXALIASWARN (unlinkat);
01266 #elif defined GNULIB_POSIXCHECK
01267 # undef unlinkat
01268 # if HAVE_RAW_DECL_UNLINKAT
01269 _GL_WARN_ON_USE (unlinkat, "unlinkat is not portable - "
01270                  "use gnulib module openat for portability");
01271 # endif
01272 #endif
01273 
01274 
01275 #if @GNULIB_USLEEP@
01276 /* Pause the execution of the current thread for N microseconds.
01277    Returns 0 on completion, or -1 on range error.
01278    See the POSIX:2001 specification
01279    <http://www.opengroup.org/susv3xsh/sleep.html>.  */
01280 # if @REPLACE_USLEEP@
01281 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
01282 #   undef usleep
01283 #   define usleep rpl_usleep
01284 #  endif
01285 _GL_FUNCDECL_RPL (usleep, int, (useconds_t n));
01286 _GL_CXXALIAS_RPL (usleep, int, (useconds_t n));
01287 # else
01288 #  if !@HAVE_USLEEP@
01289 _GL_FUNCDECL_SYS (usleep, int, (useconds_t n));
01290 #  endif
01291 _GL_CXXALIAS_SYS (usleep, int, (useconds_t n));
01292 # endif
01293 _GL_CXXALIASWARN (usleep);
01294 #elif defined GNULIB_POSIXCHECK
01295 # undef usleep
01296 # if HAVE_RAW_DECL_USLEEP
01297 _GL_WARN_ON_USE (usleep, "usleep is unportable - "
01298                  "use gnulib module usleep for portability");
01299 # endif
01300 #endif
01301 
01302 
01303 #if @GNULIB_WRITE@
01304 /* Write up to COUNT bytes starting at BUF to file descriptor FD.
01305    See the POSIX:2001 specification
01306    <http://www.opengroup.org/susv3xsh/write.html>.  */
01307 # if @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@
01308 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
01309 #   undef write
01310 #   define write rpl_write
01311 #  endif
01312 _GL_FUNCDECL_RPL (write, ssize_t, (int fd, const void *buf, size_t count)
01313                                   _GL_ARG_NONNULL ((2)));
01314 _GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count));
01315 # else
01316 /* Need to cast, because on mingw, the third parameter is
01317                                                              unsigned int count
01318    and the return type is 'int'.  */
01319 _GL_CXXALIAS_SYS_CAST (write, ssize_t, (int fd, const void *buf, size_t count));
01320 # endif
01321 _GL_CXXALIASWARN (write);
01322 #endif
01323 
01324 
01325 #endif /* _GL_UNISTD_H */
01326 #endif /* _GL_UNISTD_H */