1 /* -*- buffer-read-only: t -*- vi: set ro: */
2 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3 /* Substitute for and wrapper around <unistd.h>.
4 Copyright (C) 2003-2010 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software Foundation,
18 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
21 @PRAGMA_SYSTEM_HEADER@
25 /* Special invocation convention:
26 - On mingw, several headers, including <winsock2.h>, include <unistd.h>,
27 but we need to ensure that both the system <unistd.h> and <winsock2.h>
28 are completely included before we replace gethostname. */
29 #if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \
30 && !defined _GL_WINSOCK2_H_WITNESS && defined _WINSOCK2_H
31 /* <unistd.h> is being indirectly included for the first time from
32 <winsock2.h>; avoid declaring any overrides. */
34 # @INCLUDE_NEXT@ @NEXT_UNISTD_H@
36 # error unexpected; report this to bug-gnulib@gnu.org
38 # define _GL_WINSOCK2_H_WITNESS
40 /* Normal invocation. */
41 #elif !defined _GL_UNISTD_H
43 /* The include_next requires a split double-inclusion guard. */
45 # @INCLUDE_NEXT@ @NEXT_UNISTD_H@
48 /* Get all possible declarations of gethostname(). */
49 #if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \
50 && !defined _GL_INCLUDING_WINSOCK2_H
51 # define _GL_INCLUDING_WINSOCK2_H
52 # include <winsock2.h>
53 # undef _GL_INCLUDING_WINSOCK2_H
56 #if !defined _GL_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H
59 /* NetBSD 5.0 mis-defines NULL. Also get size_t. */
62 /* mingw doesn't define the SEEK_* or *_FILENO macros in <unistd.h>. */
63 /* Cygwin 1.7.1 declares symlinkat in <stdio.h>, not in <unistd.h>. */
64 /* But avoid namespace pollution on glibc systems. */
65 #if (!(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) \
66 || (@GNULIB_SYMLINKAT@ || defined GNULIB_POSIXCHECK)) \
67 && ! defined __GLIBC__
71 /* Cygwin 1.7.1 declares unlinkat in <fcntl.h>, not in <unistd.h>. */
72 /* But avoid namespace pollution on glibc systems. */
73 #if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__
77 /* mingw fails to declare _exit in <unistd.h>. */
78 /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */
79 /* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>. */
80 /* But avoid namespace pollution on glibc systems. */
85 /* mingw declares getcwd in <io.h>, not in <unistd.h>. */
86 #if ((@GNULIB_GETCWD@ || defined GNULIB_POSIXCHECK) \
87 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
91 #if (@GNULIB_WRITE@ || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \
92 || @GNULIB_PREAD@ || @GNULIB_PWRITE@ || defined GNULIB_POSIXCHECK)
94 # include <sys/types.h>
97 /* Get getopt(), optarg, optind, opterr, optopt.
98 But avoid namespace pollution on glibc systems. */
99 #if @GNULIB_UNISTD_H_GETOPT@ && !defined __GLIBC__ && !defined _GL_SYSTEM_GETOPT
103 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
105 /* The definition of _GL_ARG_NONNULL is copied here. */
107 /* The definition of _GL_WARN_ON_USE is copied here. */
110 #if @GNULIB_GETHOSTNAME@
111 /* Get all possible declarations of gethostname(). */
112 # if @UNISTD_H_HAVE_WINSOCK2_H@
113 # if !defined _GL_SYS_SOCKET_H
114 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
116 # define socket socket_used_without_including_sys_socket_h
118 # define connect connect_used_without_including_sys_socket_h
120 # define accept accept_used_without_including_sys_socket_h
122 # define bind bind_used_without_including_sys_socket_h
124 # define getpeername getpeername_used_without_including_sys_socket_h
126 # define getsockname getsockname_used_without_including_sys_socket_h
128 # define getsockopt getsockopt_used_without_including_sys_socket_h
130 # define listen listen_used_without_including_sys_socket_h
132 # define recv recv_used_without_including_sys_socket_h
134 # define send send_used_without_including_sys_socket_h
136 # define recvfrom recvfrom_used_without_including_sys_socket_h
138 # define sendto sendto_used_without_including_sys_socket_h
140 # define setsockopt setsockopt_used_without_including_sys_socket_h
142 # define shutdown shutdown_used_without_including_sys_socket_h
144 _GL_WARN_ON_USE (socket,
145 "socket() used without including <sys/socket.h>");
146 _GL_WARN_ON_USE (connect,
147 "connect() used without including <sys/socket.h>");
148 _GL_WARN_ON_USE (accept,
149 "accept() used without including <sys/socket.h>");
150 _GL_WARN_ON_USE (bind,
151 "bind() used without including <sys/socket.h>");
152 _GL_WARN_ON_USE (getpeername,
153 "getpeername() used without including <sys/socket.h>");
154 _GL_WARN_ON_USE (getsockname,
155 "getsockname() used without including <sys/socket.h>");
156 _GL_WARN_ON_USE (getsockopt,
157 "getsockopt() used without including <sys/socket.h>");
158 _GL_WARN_ON_USE (listen,
159 "listen() used without including <sys/socket.h>");
160 _GL_WARN_ON_USE (recv,
161 "recv() used without including <sys/socket.h>");
162 _GL_WARN_ON_USE (send,
163 "send() used without including <sys/socket.h>");
164 _GL_WARN_ON_USE (recvfrom,
165 "recvfrom() used without including <sys/socket.h>");
166 _GL_WARN_ON_USE (sendto,
167 "sendto() used without including <sys/socket.h>");
168 _GL_WARN_ON_USE (setsockopt,
169 "setsockopt() used without including <sys/socket.h>");
170 _GL_WARN_ON_USE (shutdown,
171 "shutdown() used without including <sys/socket.h>");
174 # if !defined _GL_SYS_SELECT_H
175 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
177 # define select select_used_without_including_sys_select_h
179 _GL_WARN_ON_USE (select,
180 "select() used without including <sys/select.h>");
187 /* OS/2 EMX lacks these macros. */
189 # define STDIN_FILENO 0
191 #ifndef STDOUT_FILENO
192 # define STDOUT_FILENO 1
194 #ifndef STDERR_FILENO
195 # define STDERR_FILENO 2
198 /* Ensure *_OK macros exist. */
207 /* Declare overridden functions. */
210 #if defined GNULIB_POSIXCHECK
211 /* The access() function is a security risk. */
212 _GL_WARN_ON_USE (access, "the access function is a security risk - "
213 "use the gnulib module faccessat instead");
218 /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
219 to GID (if GID is not -1). Follow symbolic links.
220 Return 0 if successful, otherwise -1 and errno set.
221 See the POSIX:2001 specification
222 <http://www.opengroup.org/susv3xsh/chown.html>. */
224 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
226 # define chown rpl_chown
228 _GL_FUNCDECL_RPL (chown, int, (const char *file, uid_t uid, gid_t gid)
229 _GL_ARG_NONNULL ((1)));
230 _GL_CXXALIAS_RPL (chown, int, (const char *file, uid_t uid, gid_t gid));
233 _GL_FUNCDECL_SYS (chown, int, (const char *file, uid_t uid, gid_t gid)
234 _GL_ARG_NONNULL ((1)));
236 _GL_CXXALIAS_SYS (chown, int, (const char *file, uid_t uid, gid_t gid));
238 _GL_CXXALIASWARN (chown);
239 #elif defined GNULIB_POSIXCHECK
241 # if HAVE_RAW_DECL_CHOWN
242 _GL_WARN_ON_USE (chown, "chown fails to follow symlinks on some systems and "
243 "doesn't treat a uid or gid of -1 on some systems - "
244 "use gnulib module chown for portability");
251 /* Automatically included by modules that need a replacement for close. */
252 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
254 # define close rpl_close
256 _GL_FUNCDECL_RPL (close, int, (int fd));
257 _GL_CXXALIAS_RPL (close, int, (int fd));
259 _GL_CXXALIAS_SYS (close, int, (int fd));
261 _GL_CXXALIASWARN (close);
262 #elif @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
264 # define close close_used_without_requesting_gnulib_module_close
265 #elif defined GNULIB_POSIXCHECK
267 /* Assume close is always declared. */
268 _GL_WARN_ON_USE (close, "close does not portably work on sockets - "
269 "use gnulib module close for portability");
274 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
277 _GL_FUNCDECL_RPL (dup, int, (int oldfd));
278 _GL_CXXALIAS_RPL (dup, int, (int oldfd));
280 _GL_CXXALIAS_SYS (dup, int, (int oldfd));
282 _GL_CXXALIASWARN (dup);
286 /* Copy the file descriptor OLDFD into file descriptor NEWFD. Do nothing if
287 NEWFD = OLDFD, otherwise close NEWFD first if it is open.
288 Return newfd if successful, otherwise -1 and errno set.
289 See the POSIX:2001 specification
290 <http://www.opengroup.org/susv3xsh/dup2.html>. */
292 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
293 # define dup2 rpl_dup2
295 _GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd));
296 _GL_CXXALIAS_RPL (dup2, int, (int oldfd, int newfd));
299 _GL_FUNCDECL_SYS (dup2, int, (int oldfd, int newfd));
301 _GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd));
303 _GL_CXXALIASWARN (dup2);
304 #elif defined GNULIB_POSIXCHECK
306 # if HAVE_RAW_DECL_DUP2
307 _GL_WARN_ON_USE (dup2, "dup2 is unportable - "
308 "use gnulib module dup2 for portability");
314 /* Copy the file descriptor OLDFD into file descriptor NEWFD, with the
316 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
317 and O_TEXT, O_BINARY (defined in "binary-io.h").
318 Close NEWFD first if it is open.
319 Return newfd if successful, otherwise -1 and errno set.
320 See the Linux man page at
321 <http://www.kernel.org/doc/man-pages/online/pages/man2/dup3.2.html>. */
323 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
324 # define dup3 rpl_dup3
326 _GL_FUNCDECL_RPL (dup3, int, (int oldfd, int newfd, int flags));
327 _GL_CXXALIAS_RPL (dup3, int, (int oldfd, int newfd, int flags));
329 _GL_FUNCDECL_SYS (dup3, int, (int oldfd, int newfd, int flags));
330 _GL_CXXALIAS_SYS (dup3, int, (int oldfd, int newfd, int flags));
332 _GL_CXXALIASWARN (dup3);
333 #elif defined GNULIB_POSIXCHECK
335 # if HAVE_RAW_DECL_DUP3
336 _GL_WARN_ON_USE (dup3, "dup3 is unportable - "
337 "use gnulib module dup3 for portability");
343 # if !@HAVE_DECL_ENVIRON@
344 /* Set of environment variables and values. An array of strings of the form
345 "VARIABLE=VALUE", terminated with a NULL. */
346 # if defined __APPLE__ && defined __MACH__
347 # include <crt_externs.h>
348 # define environ (*_NSGetEnviron ())
353 extern char **environ;
359 #elif defined GNULIB_POSIXCHECK
360 # if HAVE_RAW_DECL_ENVIRON
361 static inline char ***
366 _GL_WARN_ON_USE (rpl_environ, "environ is unportable - "
367 "use gnulib module environ for portability");
369 # define environ (*rpl_environ ())
374 #if @GNULIB_EUIDACCESS@
375 /* Like access(), except that it uses the effective user id and group id of
376 the current process. */
377 # if !@HAVE_EUIDACCESS@
378 _GL_FUNCDECL_SYS (euidaccess, int, (const char *filename, int mode)
379 _GL_ARG_NONNULL ((1)));
381 _GL_CXXALIAS_SYS (euidaccess, int, (const char *filename, int mode));
382 _GL_CXXALIASWARN (euidaccess);
383 # if defined GNULIB_POSIXCHECK
384 /* Like access(), this function is a security risk. */
385 _GL_WARN_ON_USE (euidaccess, "the euidaccess function is a security risk - "
386 "use the gnulib module faccessat instead");
388 #elif defined GNULIB_POSIXCHECK
390 # if HAVE_RAW_DECL_EUIDACCESS
391 _GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - "
392 "use gnulib module euidaccess for portability");
397 #if @GNULIB_FACCESSAT@
398 # if !@HAVE_FACCESSAT@
399 _GL_FUNCDECL_SYS (faccessat, int,
400 (int fd, char const *file, int mode, int flag)
401 _GL_ARG_NONNULL ((2)));
403 _GL_CXXALIAS_SYS (faccessat, int,
404 (int fd, char const *file, int mode, int flag));
405 _GL_CXXALIASWARN (faccessat);
406 #elif defined GNULIB_POSIXCHECK
408 # if HAVE_RAW_DECL_FACCESSAT
409 _GL_WARN_ON_USE (faccessat, "faccessat is not portable - "
410 "use gnulib module faccessat for portability");
416 /* Change the process' current working directory to the directory on which
417 the given file descriptor is open.
418 Return 0 if successful, otherwise -1 and errno set.
419 See the POSIX:2001 specification
420 <http://www.opengroup.org/susv3xsh/fchdir.html>. */
422 _GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/));
424 /* Gnulib internal hooks needed to maintain the fchdir metadata. */
425 _GL_EXTERN_C int _gl_register_fd (int fd, const char *filename)
426 _GL_ARG_NONNULL ((2));
427 _GL_EXTERN_C void _gl_unregister_fd (int fd);
428 _GL_EXTERN_C int _gl_register_dup (int oldfd, int newfd);
429 _GL_EXTERN_C const char *_gl_directory_name (int fd);
432 _GL_CXXALIAS_SYS (fchdir, int, (int /*fd*/));
433 _GL_CXXALIASWARN (fchdir);
434 #elif defined GNULIB_POSIXCHECK
436 # if HAVE_RAW_DECL_FCHDIR
437 _GL_WARN_ON_USE (fchdir, "fchdir is unportable - "
438 "use gnulib module fchdir for portability");
443 #if @GNULIB_FCHOWNAT@
444 # if @REPLACE_FCHOWNAT@
445 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
447 # define fchownat rpl_fchownat
449 _GL_FUNCDECL_RPL (fchownat, int, (int fd, char const *file,
450 uid_t owner, gid_t group, int flag)
451 _GL_ARG_NONNULL ((2)));
452 _GL_CXXALIAS_RPL (fchownat, int, (int fd, char const *file,
453 uid_t owner, gid_t group, int flag));
455 # if !@HAVE_FCHOWNAT@
456 _GL_FUNCDECL_SYS (fchownat, int, (int fd, char const *file,
457 uid_t owner, gid_t group, int flag)
458 _GL_ARG_NONNULL ((2)));
460 _GL_CXXALIAS_SYS (fchownat, int, (int fd, char const *file,
461 uid_t owner, gid_t group, int flag));
463 _GL_CXXALIASWARN (fchownat);
464 #elif defined GNULIB_POSIXCHECK
466 # if HAVE_RAW_DECL_FCHOWNAT
467 _GL_WARN_ON_USE (fchownat, "fchownat is not portable - "
468 "use gnulib module openat for portability");
474 /* Synchronize changes to a file.
475 Return 0 if successful, otherwise -1 and errno set.
476 See POSIX:2001 specification
477 <http://www.opengroup.org/susv3xsh/fsync.html>. */
479 _GL_FUNCDECL_SYS (fsync, int, (int fd));
481 _GL_CXXALIAS_SYS (fsync, int, (int fd));
482 _GL_CXXALIASWARN (fsync);
483 #elif defined GNULIB_POSIXCHECK
485 # if HAVE_RAW_DECL_FSYNC
486 _GL_WARN_ON_USE (fsync, "fsync is unportable - "
487 "use gnulib module fsync for portability");
492 #if @GNULIB_FTRUNCATE@
493 /* Change the size of the file to which FD is opened to become equal to LENGTH.
494 Return 0 if successful, otherwise -1 and errno set.
495 See the POSIX:2001 specification
496 <http://www.opengroup.org/susv3xsh/ftruncate.html>. */
497 # if !@HAVE_FTRUNCATE@
498 _GL_FUNCDECL_SYS (ftruncate, int, (int fd, off_t length));
500 _GL_CXXALIAS_SYS (ftruncate, int, (int fd, off_t length));
501 _GL_CXXALIASWARN (ftruncate);
502 #elif defined GNULIB_POSIXCHECK
504 # if HAVE_RAW_DECL_FTRUNCATE
505 _GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - "
506 "use gnulib module ftruncate for portability");
512 /* Get the name of the current working directory, and put it in SIZE bytes
514 Return BUF if successful, or NULL if the directory couldn't be determined
515 or SIZE was too small.
516 See the POSIX:2001 specification
517 <http://www.opengroup.org/susv3xsh/getcwd.html>.
518 Additionally, the gnulib module 'getcwd' guarantees the following GNU
519 extension: If BUF is NULL, an array is allocated with 'malloc'; the array
520 is SIZE bytes long, unless SIZE == 0, in which case it is as big as
522 # if @REPLACE_GETCWD@
523 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
524 # define getcwd rpl_getcwd
526 _GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size));
527 _GL_CXXALIAS_RPL (getcwd, char *, (char *buf, size_t size));
529 /* Need to cast, because on mingw, the second parameter is
531 _GL_CXXALIAS_SYS_CAST (getcwd, char *, (char *buf, size_t size));
533 _GL_CXXALIASWARN (getcwd);
534 #elif defined GNULIB_POSIXCHECK
536 # if HAVE_RAW_DECL_GETCWD
537 _GL_WARN_ON_USE (getcwd, "getcwd is unportable - "
538 "use gnulib module getcwd for portability");
543 #if @GNULIB_GETDOMAINNAME@
544 /* Return the NIS domain name of the machine.
545 WARNING! The NIS domain name is unrelated to the fully qualified host name
546 of the machine. It is also unrelated to email addresses.
547 WARNING! The NIS domain name is usually the empty string or "(none)" when
550 Put up to LEN bytes of the NIS domain name into NAME.
551 Null terminate it if the name is shorter than LEN.
552 If the NIS domain name is longer than LEN, set errno = EINVAL and return -1.
553 Return 0 if successful, otherwise set errno and return -1. */
554 # if !@HAVE_GETDOMAINNAME@
555 _GL_FUNCDECL_SYS (getdomainname, int, (char *name, size_t len)
556 _GL_ARG_NONNULL ((1)));
558 /* Need to cast, because on MacOS X 10.5 systems, the second parameter is
560 _GL_CXXALIAS_SYS_CAST (getdomainname, int, (char *name, size_t len));
561 _GL_CXXALIASWARN (getdomainname);
562 #elif defined GNULIB_POSIXCHECK
563 # undef getdomainname
564 # if HAVE_RAW_DECL_GETDOMAINNAME
565 _GL_WARN_ON_USE (getdomainname, "getdomainname is unportable - "
566 "use gnulib module getdomainname for portability");
571 #if @GNULIB_GETDTABLESIZE@
572 /* Return the maximum number of file descriptors in the current process.
573 In POSIX, this is same as sysconf (_SC_OPEN_MAX). */
574 # if !@HAVE_GETDTABLESIZE@
575 _GL_FUNCDECL_SYS (getdtablesize, int, (void));
577 _GL_CXXALIAS_SYS (getdtablesize, int, (void));
578 _GL_CXXALIASWARN (getdtablesize);
579 #elif defined GNULIB_POSIXCHECK
580 # undef getdtablesize
581 # if HAVE_RAW_DECL_GETDTABLESIZE
582 _GL_WARN_ON_USE (getdtablesize, "getdtablesize is unportable - "
583 "use gnulib module getdtablesize for portability");
588 #if @GNULIB_GETGROUPS@
589 /* Return the supplemental groups that the current process belongs to.
590 It is unspecified whether the effective group id is in the list.
591 If N is 0, return the group count; otherwise, N describes how many
592 entries are available in GROUPS. Return -1 and set errno if N is
593 not 0 and not large enough. Fails with ENOSYS on some systems. */
594 # if @REPLACE_GETGROUPS@
595 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
597 # define getgroups rpl_getgroups
599 _GL_FUNCDECL_RPL (getgroups, int, (int n, gid_t *groups));
600 _GL_CXXALIAS_RPL (getgroups, int, (int n, gid_t *groups));
602 # if !@HAVE_GETGROUPS@
603 _GL_FUNCDECL_SYS (getgroups, int, (int n, gid_t *groups));
605 _GL_CXXALIAS_SYS (getgroups, int, (int n, gid_t *groups));
607 _GL_CXXALIASWARN (getgroups);
608 #elif defined GNULIB_POSIXCHECK
610 # if HAVE_RAW_DECL_GETGROUPS
611 _GL_WARN_ON_USE (getgroups, "getgroups is unportable - "
612 "use gnulib module getgroups for portability");
617 #if @GNULIB_GETHOSTNAME@
618 /* Return the standard host name of the machine.
619 WARNING! The host name may or may not be fully qualified.
621 Put up to LEN bytes of the host name into NAME.
622 Null terminate it if the name is shorter than LEN.
623 If the host name is longer than LEN, set errno = EINVAL and return -1.
624 Return 0 if successful, otherwise set errno and return -1. */
625 # if @UNISTD_H_HAVE_WINSOCK2_H@
626 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
628 # define gethostname rpl_gethostname
630 _GL_FUNCDECL_RPL (gethostname, int, (char *name, size_t len)
631 _GL_ARG_NONNULL ((1)));
632 _GL_CXXALIAS_RPL (gethostname, int, (char *name, size_t len));
634 # if !@HAVE_GETHOSTNAME@
635 _GL_FUNCDECL_SYS (gethostname, int, (char *name, size_t len)
636 _GL_ARG_NONNULL ((1)));
638 /* Need to cast, because on Solaris 10 systems, the second parameter is
640 _GL_CXXALIAS_SYS_CAST (gethostname, int, (char *name, size_t len));
642 _GL_CXXALIASWARN (gethostname);
643 #elif @UNISTD_H_HAVE_WINSOCK2_H@
645 # define gethostname gethostname_used_without_requesting_gnulib_module_gethostname
646 #elif defined GNULIB_POSIXCHECK
648 # if HAVE_RAW_DECL_GETHOSTNAME
649 _GL_WARN_ON_USE (gethostname, "gethostname is unportable - "
650 "use gnulib module gethostname for portability");
655 #if @GNULIB_GETLOGIN@
656 /* Returns the user's login name, or NULL if it cannot be found. Upon error,
657 returns NULL with errno set.
659 See <http://www.opengroup.org/susv3xsh/getlogin.html>.
661 Most programs don't need to use this function, because the information is
662 available through environment variables:
663 ${LOGNAME-$USER} on Unix platforms,
664 $USERNAME on native Windows platforms.
666 # if !@HAVE_GETLOGIN@
667 _GL_FUNCDECL_SYS (getlogin, char *, (void));
669 _GL_CXXALIAS_SYS (getlogin, char *, (void));
670 _GL_CXXALIASWARN (getlogin);
671 #elif defined GNULIB_POSIXCHECK
673 # if HAVE_RAW_DECL_GETLOGIN
674 _GL_WARN_ON_USE (getlogin, "getlogin is unportable - "
675 "use gnulib module getlogin for portability");
680 #if @GNULIB_GETLOGIN_R@
681 /* Copies the user's login name to NAME.
682 The array pointed to by NAME has room for SIZE bytes.
684 Returns 0 if successful. Upon error, an error number is returned, or -1 in
685 the case that the login name cannot be found but no specific error is
686 provided (this case is hopefully rare but is left open by the POSIX spec).
688 See <http://www.opengroup.org/susv3xsh/getlogin.html>.
690 Most programs don't need to use this function, because the information is
691 available through environment variables:
692 ${LOGNAME-$USER} on Unix platforms,
693 $USERNAME on native Windows platforms.
695 # if !@HAVE_DECL_GETLOGIN_R@
696 _GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size)
697 _GL_ARG_NONNULL ((1)));
699 /* Need to cast, because on Solaris 10 systems, the second argument is
701 _GL_CXXALIAS_SYS_CAST (getlogin_r, int, (char *name, size_t size));
702 _GL_CXXALIASWARN (getlogin_r);
703 #elif defined GNULIB_POSIXCHECK
705 # if HAVE_RAW_DECL_GETLOGIN_R
706 _GL_WARN_ON_USE (getlogin_r, "getlogin_r is unportable - "
707 "use gnulib module getlogin_r for portability");
712 #if @GNULIB_GETPAGESIZE@
713 # if @REPLACE_GETPAGESIZE@
714 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
715 # define getpagesize rpl_getpagesize
717 _GL_FUNCDECL_RPL (getpagesize, int, (void));
718 _GL_CXXALIAS_RPL (getpagesize, int, (void));
720 # if !@HAVE_GETPAGESIZE@
721 # if !defined getpagesize
722 /* This is for POSIX systems. */
723 # if !defined _gl_getpagesize && defined _SC_PAGESIZE
724 # if ! (defined __VMS && __VMS_VER < 70000000)
725 # define _gl_getpagesize() sysconf (_SC_PAGESIZE)
728 /* This is for older VMS. */
729 # if !defined _gl_getpagesize && defined __VMS
731 # define _gl_getpagesize() 8192
733 # define _gl_getpagesize() 512
736 /* This is for BeOS. */
737 # if !defined _gl_getpagesize && @HAVE_OS_H@
739 # if defined B_PAGE_SIZE
740 # define _gl_getpagesize() B_PAGE_SIZE
743 /* This is for AmigaOS4.0. */
744 # if !defined _gl_getpagesize && defined __amigaos4__
745 # define _gl_getpagesize() 2048
747 /* This is for older Unix systems. */
748 # if !defined _gl_getpagesize && @HAVE_SYS_PARAM_H@
749 # include <sys/param.h>
750 # ifdef EXEC_PAGESIZE
751 # define _gl_getpagesize() EXEC_PAGESIZE
757 # define _gl_getpagesize() (NBPG * CLSIZE)
760 # define _gl_getpagesize() NBPC
765 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
766 # define getpagesize() _gl_getpagesize ()
771 return _gl_getpagesize ();
776 /* Need to cast, because on Cygwin 1.5.x systems, the return type is size_t. */
777 _GL_CXXALIAS_SYS_CAST (getpagesize, int, (void));
779 # if @HAVE_DECL_GETPAGESIZE@
780 _GL_CXXALIASWARN (getpagesize);
782 #elif defined GNULIB_POSIXCHECK
784 # if HAVE_RAW_DECL_GETPAGESIZE
785 _GL_WARN_ON_USE (getpagesize, "getpagesize is unportable - "
786 "use gnulib module getpagesize for portability");
791 #if @GNULIB_GETUSERSHELL@
792 /* Return the next valid login shell on the system, or NULL when the end of
793 the list has been reached. */
794 # if !@HAVE_DECL_GETUSERSHELL@
795 _GL_FUNCDECL_SYS (getusershell, char *, (void));
797 _GL_CXXALIAS_SYS (getusershell, char *, (void));
798 _GL_CXXALIASWARN (getusershell);
799 #elif defined GNULIB_POSIXCHECK
801 # if HAVE_RAW_DECL_GETUSERSHELL
802 _GL_WARN_ON_USE (getusershell, "getusershell is unportable - "
803 "use gnulib module getusershell for portability");
807 #if @GNULIB_GETUSERSHELL@
808 /* Rewind to pointer that is advanced at each getusershell() call. */
809 # if !@HAVE_DECL_GETUSERSHELL@
810 _GL_FUNCDECL_SYS (setusershell, void, (void));
812 _GL_CXXALIAS_SYS (setusershell, void, (void));
813 _GL_CXXALIASWARN (setusershell);
814 #elif defined GNULIB_POSIXCHECK
816 # if HAVE_RAW_DECL_SETUSERSHELL
817 _GL_WARN_ON_USE (setusershell, "setusershell is unportable - "
818 "use gnulib module getusershell for portability");
822 #if @GNULIB_GETUSERSHELL@
823 /* Free the pointer that is advanced at each getusershell() call and
824 associated resources. */
825 # if !@HAVE_DECL_GETUSERSHELL@
826 _GL_FUNCDECL_SYS (endusershell, void, (void));
828 _GL_CXXALIAS_SYS (endusershell, void, (void));
829 _GL_CXXALIASWARN (endusershell);
830 #elif defined GNULIB_POSIXCHECK
832 # if HAVE_RAW_DECL_ENDUSERSHELL
833 _GL_WARN_ON_USE (endusershell, "endusershell is unportable - "
834 "use gnulib module getusershell for portability");
840 /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
841 to GID (if GID is not -1). Do not follow symbolic links.
842 Return 0 if successful, otherwise -1 and errno set.
843 See the POSIX:2001 specification
844 <http://www.opengroup.org/susv3xsh/lchown.html>. */
845 # if @REPLACE_LCHOWN@
846 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
848 # define lchown rpl_lchown
850 _GL_FUNCDECL_RPL (lchown, int, (char const *file, uid_t owner, gid_t group)
851 _GL_ARG_NONNULL ((1)));
852 _GL_CXXALIAS_RPL (lchown, int, (char const *file, uid_t owner, gid_t group));
855 _GL_FUNCDECL_SYS (lchown, int, (char const *file, uid_t owner, gid_t group)
856 _GL_ARG_NONNULL ((1)));
858 _GL_CXXALIAS_SYS (lchown, int, (char const *file, uid_t owner, gid_t group));
860 _GL_CXXALIASWARN (lchown);
861 #elif defined GNULIB_POSIXCHECK
863 # if HAVE_RAW_DECL_LCHOWN
864 _GL_WARN_ON_USE (lchown, "lchown is unportable to pre-POSIX.1-2001 systems - "
865 "use gnulib module lchown for portability");
871 /* Create a new hard link for an existing file.
872 Return 0 if successful, otherwise -1 and errno set.
873 See POSIX:2001 specification
874 <http://www.opengroup.org/susv3xsh/link.html>. */
876 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
877 # define link rpl_link
879 _GL_FUNCDECL_RPL (link, int, (const char *path1, const char *path2)
880 _GL_ARG_NONNULL ((1, 2)));
881 _GL_CXXALIAS_RPL (link, int, (const char *path1, const char *path2));
884 _GL_FUNCDECL_SYS (link, int, (const char *path1, const char *path2)
885 _GL_ARG_NONNULL ((1, 2)));
887 _GL_CXXALIAS_SYS (link, int, (const char *path1, const char *path2));
889 _GL_CXXALIASWARN (link);
890 #elif defined GNULIB_POSIXCHECK
892 # if HAVE_RAW_DECL_LINK
893 _GL_WARN_ON_USE (link, "link is unportable - "
894 "use gnulib module link for portability");
900 /* Create a new hard link for an existing file, relative to two
901 directories. FLAG controls whether symlinks are followed.
902 Return 0 if successful, otherwise -1 and errno set. */
903 # if @REPLACE_LINKAT@
904 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
906 # define linkat rpl_linkat
908 _GL_FUNCDECL_RPL (linkat, int,
909 (int fd1, const char *path1, int fd2, const char *path2,
911 _GL_ARG_NONNULL ((2, 4)));
912 _GL_CXXALIAS_RPL (linkat, int,
913 (int fd1, const char *path1, int fd2, const char *path2,
917 _GL_FUNCDECL_SYS (linkat, int,
918 (int fd1, const char *path1, int fd2, const char *path2,
920 _GL_ARG_NONNULL ((2, 4)));
922 _GL_CXXALIAS_SYS (linkat, int,
923 (int fd1, const char *path1, int fd2, const char *path2,
926 _GL_CXXALIASWARN (linkat);
927 #elif defined GNULIB_POSIXCHECK
929 # if HAVE_RAW_DECL_LINKAT
930 _GL_WARN_ON_USE (linkat, "linkat is unportable - "
931 "use gnulib module linkat for portability");
937 /* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END.
938 Return the new offset if successful, otherwise -1 and errno set.
939 See the POSIX:2001 specification
940 <http://www.opengroup.org/susv3xsh/lseek.html>. */
942 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
943 # define lseek rpl_lseek
945 _GL_FUNCDECL_RPL (lseek, off_t, (int fd, off_t offset, int whence));
946 _GL_CXXALIAS_RPL (lseek, off_t, (int fd, off_t offset, int whence));
948 _GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence));
950 _GL_CXXALIASWARN (lseek);
951 #elif defined GNULIB_POSIXCHECK
953 # if HAVE_RAW_DECL_LSEEK
954 _GL_WARN_ON_USE (lseek, "lseek does not fail with ESPIPE on pipes on some "
955 "systems - use gnulib module lseek for portability");
961 /* Create a pipe, applying the given flags when opening the read-end of the
962 pipe and the write-end of the pipe.
963 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
964 and O_TEXT, O_BINARY (defined in "binary-io.h").
965 Store the read-end as fd[0] and the write-end as fd[1].
966 Return 0 upon success, or -1 with errno set upon failure.
967 See also the Linux man page at
968 <http://www.kernel.org/doc/man-pages/online/pages/man2/pipe2.2.html>. */
970 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
971 # define pipe2 rpl_pipe2
973 _GL_FUNCDECL_RPL (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1)));
974 _GL_CXXALIAS_RPL (pipe2, int, (int fd[2], int flags));
976 _GL_FUNCDECL_SYS (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1)));
977 _GL_CXXALIAS_SYS (pipe2, int, (int fd[2], int flags));
979 _GL_CXXALIASWARN (pipe2);
980 #elif defined GNULIB_POSIXCHECK
982 # if HAVE_RAW_DECL_PIPE2
983 _GL_WARN_ON_USE (pipe2, "pipe2 is unportable - "
984 "use gnulib module pipe2 for portability");
990 /* Read at most BUFSIZE bytes from FD into BUF, starting at OFFSET.
991 Return the number of bytes placed into BUF if successful, otherwise
992 set errno and return -1. 0 indicates EOF. See the POSIX:2001
993 specification <http://www.opengroup.org/susv3xsh/pread.html>. */
995 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
996 # define pread rpl_pread
998 _GL_FUNCDECL_RPL (pread, ssize_t,
999 (int fd, void *buf, size_t bufsize, off_t offset)
1000 _GL_ARG_NONNULL ((2)));
1001 _GL_CXXALIAS_RPL (pread, ssize_t,
1002 (int fd, void *buf, size_t bufsize, off_t offset));
1005 _GL_FUNCDECL_SYS (pread, ssize_t,
1006 (int fd, void *buf, size_t bufsize, off_t offset)
1007 _GL_ARG_NONNULL ((2)));
1009 _GL_CXXALIAS_SYS (pread, ssize_t,
1010 (int fd, void *buf, size_t bufsize, off_t offset));
1012 _GL_CXXALIASWARN (pread);
1013 #elif defined GNULIB_POSIXCHECK
1015 # if HAVE_RAW_DECL_PREAD
1016 _GL_WARN_ON_USE (pread, "pread is unportable - "
1017 "use gnulib module pread for portability");
1023 /* Write at most BUFSIZE bytes from BUF into FD, starting at OFFSET.
1024 Return the number of bytes written if successful, otherwise
1025 set errno and return -1. 0 indicates nothing written. See the
1026 POSIX:2001 specification
1027 <http://www.opengroup.org/susv3xsh/pwrite.html>. */
1028 # if @REPLACE_PWRITE@
1029 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1030 # define pwrite rpl_pwrite
1032 _GL_FUNCDECL_RPL (pwrite, ssize_t,
1033 (int fd, const void *buf, size_t bufsize, off_t offset)
1034 _GL_ARG_NONNULL ((2)));
1035 _GL_CXXALIAS_RPL (pwrite, ssize_t,
1036 (int fd, const void *buf, size_t bufsize, off_t offset));
1039 _GL_FUNCDECL_SYS (pwrite, ssize_t,
1040 (int fd, const void *buf, size_t bufsize, off_t offset)
1041 _GL_ARG_NONNULL ((2)));
1043 _GL_CXXALIAS_SYS (pwrite, ssize_t,
1044 (int fd, const void *buf, size_t bufsize, off_t offset));
1046 _GL_CXXALIASWARN (pwrite);
1047 #elif defined GNULIB_POSIXCHECK
1049 # if HAVE_RAW_DECL_PWRITE
1050 _GL_WARN_ON_USE (pwrite, "pwrite is unportable - "
1051 "use gnulib module pwrite for portability");
1056 #if @GNULIB_READLINK@
1057 /* Read the contents of the symbolic link FILE and place the first BUFSIZE
1058 bytes of it into BUF. Return the number of bytes placed into BUF if
1059 successful, otherwise -1 and errno set.
1060 See the POSIX:2001 specification
1061 <http://www.opengroup.org/susv3xsh/readlink.html>. */
1062 # if @REPLACE_READLINK@
1063 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1064 # define readlink rpl_readlink
1066 _GL_FUNCDECL_RPL (readlink, ssize_t,
1067 (const char *file, char *buf, size_t bufsize)
1068 _GL_ARG_NONNULL ((1, 2)));
1069 _GL_CXXALIAS_RPL (readlink, ssize_t,
1070 (const char *file, char *buf, size_t bufsize));
1072 # if !@HAVE_READLINK@
1073 _GL_FUNCDECL_SYS (readlink, ssize_t,
1074 (const char *file, char *buf, size_t bufsize)
1075 _GL_ARG_NONNULL ((1, 2)));
1077 _GL_CXXALIAS_SYS (readlink, ssize_t,
1078 (const char *file, char *buf, size_t bufsize));
1080 _GL_CXXALIASWARN (readlink);
1081 #elif defined GNULIB_POSIXCHECK
1083 # if HAVE_RAW_DECL_READLINK
1084 _GL_WARN_ON_USE (readlink, "readlink is unportable - "
1085 "use gnulib module readlink for portability");
1090 #if @GNULIB_READLINKAT@
1091 # if !@HAVE_READLINKAT@
1092 _GL_FUNCDECL_SYS (readlinkat, ssize_t,
1093 (int fd, char const *file, char *buf, size_t len)
1094 _GL_ARG_NONNULL ((2, 3)));
1096 _GL_CXXALIAS_SYS (readlinkat, ssize_t,
1097 (int fd, char const *file, char *buf, size_t len));
1098 _GL_CXXALIASWARN (readlinkat);
1099 #elif defined GNULIB_POSIXCHECK
1101 # if HAVE_RAW_DECL_READLINKAT
1102 _GL_WARN_ON_USE (readlinkat, "readlinkat is not portable - "
1103 "use gnulib module readlinkat for portability");
1109 /* Remove the directory DIR. */
1110 # if @REPLACE_RMDIR@
1111 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1112 # define rmdir rpl_rmdir
1114 _GL_FUNCDECL_RPL (rmdir, int, (char const *name) _GL_ARG_NONNULL ((1)));
1115 _GL_CXXALIAS_RPL (rmdir, int, (char const *name));
1117 _GL_CXXALIAS_SYS (rmdir, int, (char const *name));
1119 _GL_CXXALIASWARN (rmdir);
1120 #elif defined GNULIB_POSIXCHECK
1122 # if HAVE_RAW_DECL_RMDIR
1123 _GL_WARN_ON_USE (rmdir, "rmdir is unportable - "
1124 "use gnulib module rmdir for portability");
1130 /* Pause the execution of the current thread for N seconds.
1131 Returns the number of seconds left to sleep.
1132 See the POSIX:2001 specification
1133 <http://www.opengroup.org/susv3xsh/sleep.html>. */
1134 # if @REPLACE_SLEEP@
1135 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1137 # define sleep rpl_sleep
1139 _GL_FUNCDECL_RPL (sleep, unsigned int, (unsigned int n));
1140 _GL_CXXALIAS_RPL (sleep, unsigned int, (unsigned int n));
1143 _GL_FUNCDECL_SYS (sleep, unsigned int, (unsigned int n));
1145 _GL_CXXALIAS_SYS (sleep, unsigned int, (unsigned int n));
1147 _GL_CXXALIASWARN (sleep);
1148 #elif defined GNULIB_POSIXCHECK
1150 # if HAVE_RAW_DECL_SLEEP
1151 _GL_WARN_ON_USE (sleep, "sleep is unportable - "
1152 "use gnulib module sleep for portability");
1157 #if @GNULIB_SYMLINK@
1158 # if @REPLACE_SYMLINK@
1159 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1161 # define symlink rpl_symlink
1163 _GL_FUNCDECL_RPL (symlink, int, (char const *contents, char const *file)
1164 _GL_ARG_NONNULL ((1, 2)));
1165 _GL_CXXALIAS_RPL (symlink, int, (char const *contents, char const *file));
1167 # if !@HAVE_SYMLINK@
1168 _GL_FUNCDECL_SYS (symlink, int, (char const *contents, char const *file)
1169 _GL_ARG_NONNULL ((1, 2)));
1171 _GL_CXXALIAS_SYS (symlink, int, (char const *contents, char const *file));
1173 _GL_CXXALIASWARN (symlink);
1174 #elif defined GNULIB_POSIXCHECK
1176 # if HAVE_RAW_DECL_SYMLINK
1177 _GL_WARN_ON_USE (symlink, "symlink is not portable - "
1178 "use gnulib module symlink for portability");
1183 #if @GNULIB_SYMLINKAT@
1184 # if !@HAVE_SYMLINKAT@
1185 _GL_FUNCDECL_SYS (symlinkat, int,
1186 (char const *contents, int fd, char const *file)
1187 _GL_ARG_NONNULL ((1, 3)));
1189 _GL_CXXALIAS_SYS (symlinkat, int,
1190 (char const *contents, int fd, char const *file));
1191 _GL_CXXALIASWARN (symlinkat);
1192 #elif defined GNULIB_POSIXCHECK
1194 # if HAVE_RAW_DECL_SYMLINKAT
1195 _GL_WARN_ON_USE (symlinkat, "symlinkat is not portable - "
1196 "use gnulib module symlinkat for portability");
1201 #if @GNULIB_TTYNAME_R@
1202 /* Store at most BUFLEN characters of the pathname of the terminal FD is
1203 open on in BUF. Return 0 on success, otherwise an error number. */
1204 # if @REPLACE_TTYNAME_R@
1205 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1207 # define ttyname_r rpl_ttyname_r
1209 _GL_FUNCDECL_RPL (ttyname_r, int,
1210 (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
1211 _GL_CXXALIAS_RPL (ttyname_r, int,
1212 (int fd, char *buf, size_t buflen));
1214 # if !@HAVE_TTYNAME_R@
1215 _GL_FUNCDECL_SYS (ttyname_r, int,
1216 (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
1218 _GL_CXXALIAS_SYS (ttyname_r, int,
1219 (int fd, char *buf, size_t buflen));
1221 _GL_CXXALIASWARN (ttyname_r);
1222 #elif defined GNULIB_POSIXCHECK
1224 # if HAVE_RAW_DECL_TTYNAME_R
1225 _GL_WARN_ON_USE (ttyname_r, "ttyname_r is not portable - "
1226 "use gnulib module ttyname_r for portability");
1232 # if @REPLACE_UNLINK@
1233 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1235 # define unlink rpl_unlink
1237 _GL_FUNCDECL_RPL (unlink, int, (char const *file) _GL_ARG_NONNULL ((1)));
1238 _GL_CXXALIAS_RPL (unlink, int, (char const *file));
1240 _GL_CXXALIAS_SYS (unlink, int, (char const *file));
1242 _GL_CXXALIASWARN (unlink);
1243 #elif defined GNULIB_POSIXCHECK
1245 # if HAVE_RAW_DECL_UNLINK
1246 _GL_WARN_ON_USE (unlink, "unlink is not portable - "
1247 "use gnulib module unlink for portability");
1252 #if @GNULIB_UNLINKAT@
1253 # if @REPLACE_UNLINKAT@
1254 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1256 # define unlinkat rpl_unlinkat
1258 _GL_FUNCDECL_RPL (unlinkat, int, (int fd, char const *file, int flag)
1259 _GL_ARG_NONNULL ((2)));
1260 _GL_CXXALIAS_RPL (unlinkat, int, (int fd, char const *file, int flag));
1262 # if !@HAVE_UNLINKAT@
1263 _GL_FUNCDECL_SYS (unlinkat, int, (int fd, char const *file, int flag)
1264 _GL_ARG_NONNULL ((2)));
1266 _GL_CXXALIAS_SYS (unlinkat, int, (int fd, char const *file, int flag));
1268 _GL_CXXALIASWARN (unlinkat);
1269 #elif defined GNULIB_POSIXCHECK
1271 # if HAVE_RAW_DECL_UNLINKAT
1272 _GL_WARN_ON_USE (unlinkat, "unlinkat is not portable - "
1273 "use gnulib module openat for portability");
1279 /* Pause the execution of the current thread for N microseconds.
1280 Returns 0 on completion, or -1 on range error.
1281 See the POSIX:2001 specification
1282 <http://www.opengroup.org/susv3xsh/sleep.html>. */
1283 # if @REPLACE_USLEEP@
1284 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1286 # define usleep rpl_usleep
1288 _GL_FUNCDECL_RPL (usleep, int, (useconds_t n));
1289 _GL_CXXALIAS_RPL (usleep, int, (useconds_t n));
1292 _GL_FUNCDECL_SYS (usleep, int, (useconds_t n));
1294 _GL_CXXALIAS_SYS (usleep, int, (useconds_t n));
1296 _GL_CXXALIASWARN (usleep);
1297 #elif defined GNULIB_POSIXCHECK
1299 # if HAVE_RAW_DECL_USLEEP
1300 _GL_WARN_ON_USE (usleep, "usleep is unportable - "
1301 "use gnulib module usleep for portability");
1307 /* Write up to COUNT bytes starting at BUF to file descriptor FD.
1308 See the POSIX:2001 specification
1309 <http://www.opengroup.org/susv3xsh/write.html>. */
1310 # if @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@
1311 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1313 # define write rpl_write
1315 _GL_FUNCDECL_RPL (write, ssize_t, (int fd, const void *buf, size_t count)
1316 _GL_ARG_NONNULL ((2)));
1317 _GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count));
1319 /* Need to cast, because on mingw, the third parameter is
1321 and the return type is 'int'. */
1322 _GL_CXXALIAS_SYS_CAST (write, ssize_t, (int fd, const void *buf, size_t count));
1324 _GL_CXXALIASWARN (write);
1328 #endif /* _GL_UNISTD_H */
1329 #endif /* _GL_UNISTD_H */