annotate lib/unistd.in.h @ 112450:16ddab338c43

Remove HAVE_RAW_DECL_CHOWN etc. from config.h
author Paul Eggert <eggert@cs.ucla.edu>
date Sun, 23 Jan 2011 20:53:39 -0800
parents babd014aab81
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
112311
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1 /* Substitute for and wrapper around <unistd.h>.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
2 Copyright (C) 2003-2011 Free Software Foundation, Inc.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
3
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
4 This program is free software; you can redistribute it and/or modify
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
5 it under the terms of the GNU General Public License as published by
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
6 the Free Software Foundation; either version 3, or (at your option)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
7 any later version.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
8
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
12 GNU General Public License for more details.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
13
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
14 You should have received a copy of the GNU General Public License
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
15 along with this program; if not, write to the Free Software Foundation,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
16 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
17
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
18 #if __GNUC__ >= 3
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
19 @PRAGMA_SYSTEM_HEADER@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
20 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
21 @PRAGMA_COLUMNS@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
22
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
23 /* Special invocation convention:
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
24 - On mingw, several headers, including <winsock2.h>, include <unistd.h>,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
25 but we need to ensure that both the system <unistd.h> and <winsock2.h>
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
26 are completely included before we replace gethostname. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
27 #if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
28 && !defined _GL_WINSOCK2_H_WITNESS && defined _WINSOCK2_H
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
29 /* <unistd.h> is being indirectly included for the first time from
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
30 <winsock2.h>; avoid declaring any overrides. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
31 # if @HAVE_UNISTD_H@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
32 # @INCLUDE_NEXT@ @NEXT_UNISTD_H@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
33 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
34 # error unexpected; report this to bug-gnulib@gnu.org
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
35 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
36 # define _GL_WINSOCK2_H_WITNESS
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
37
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
38 /* Normal invocation. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
39 #elif !defined _GL_UNISTD_H
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
40
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
41 /* The include_next requires a split double-inclusion guard. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
42 #if @HAVE_UNISTD_H@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
43 # @INCLUDE_NEXT@ @NEXT_UNISTD_H@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
44 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
45
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
46 /* Get all possible declarations of gethostname(). */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
47 #if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
48 && !defined _GL_INCLUDING_WINSOCK2_H
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
49 # define _GL_INCLUDING_WINSOCK2_H
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
50 # include <winsock2.h>
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
51 # undef _GL_INCLUDING_WINSOCK2_H
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
52 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
53
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
54 #if !defined _GL_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
55 #define _GL_UNISTD_H
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
56
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
57 /* NetBSD 5.0 mis-defines NULL. Also get size_t. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
58 #include <stddef.h>
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
59
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
60 /* mingw doesn't define the SEEK_* or *_FILENO macros in <unistd.h>. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
61 /* Cygwin 1.7.1 declares symlinkat in <stdio.h>, not in <unistd.h>. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
62 /* But avoid namespace pollution on glibc systems. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
63 #if (!(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) \
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
64 || ((@GNULIB_SYMLINKAT@ || defined GNULIB_POSIXCHECK) \
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
65 && defined __CYGWIN__)) \
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
66 && ! defined __GLIBC__
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
67 # include <stdio.h>
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
68 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
69
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
70 /* Cygwin 1.7.1 declares unlinkat in <fcntl.h>, not in <unistd.h>. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
71 /* But avoid namespace pollution on glibc systems. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
72 #if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) && defined __CYGWIN__ \
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
73 && ! defined __GLIBC__
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
74 # include <fcntl.h>
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
75 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
76
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
77 /* mingw fails to declare _exit in <unistd.h>. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
78 /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
79 /* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
80 /* But avoid namespace pollution on glibc systems. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
81 #ifndef __GLIBC__
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
82 # include <stdlib.h>
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
83 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
84
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
85 /* mingw declares getcwd in <io.h>, not in <unistd.h>. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
86 #if ((@GNULIB_GETCWD@ || defined GNULIB_POSIXCHECK) \
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
87 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
88 # include <io.h>
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
89 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
90
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
91 /* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
92 NonStop Kernel declares gethostname in <netdb.h>, not in <unistd.h>. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
93 /* But avoid namespace pollution on glibc systems. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
94 #if ((@GNULIB_GETDOMAINNAME@ && (defined _AIX || defined __osf__)) \
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
95 || (@GNULIB_GETHOSTNAME@ && defined __TANDEM)) \
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
96 && !defined __GLIBC__
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
97 # include <netdb.h>
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
98 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
99
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
100 #if (@GNULIB_WRITE@ || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
101 || @GNULIB_PREAD@ || @GNULIB_PWRITE@ || defined GNULIB_POSIXCHECK)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
102 /* Get ssize_t. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
103 # include <sys/types.h>
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
104 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
105
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
106 /* Get getopt(), optarg, optind, opterr, optopt.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
107 But avoid namespace pollution on glibc systems. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
108 #if @GNULIB_UNISTD_H_GETOPT@ && !defined __GLIBC__ && !defined _GL_SYSTEM_GETOPT
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
109 # include <getopt.h>
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
110 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
111
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
112 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
113
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
114 /* The definition of _GL_ARG_NONNULL is copied here. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
115
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
116 /* The definition of _GL_WARN_ON_USE is copied here. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
117
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
118
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
119 #if @GNULIB_GETHOSTNAME@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
120 /* Get all possible declarations of gethostname(). */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
121 # if @UNISTD_H_HAVE_WINSOCK2_H@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
122 # if !defined _GL_SYS_SOCKET_H
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
123 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
124 # undef socket
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
125 # define socket socket_used_without_including_sys_socket_h
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
126 # undef connect
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
127 # define connect connect_used_without_including_sys_socket_h
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
128 # undef accept
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
129 # define accept accept_used_without_including_sys_socket_h
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
130 # undef bind
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
131 # define bind bind_used_without_including_sys_socket_h
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
132 # undef getpeername
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
133 # define getpeername getpeername_used_without_including_sys_socket_h
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
134 # undef getsockname
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
135 # define getsockname getsockname_used_without_including_sys_socket_h
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
136 # undef getsockopt
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
137 # define getsockopt getsockopt_used_without_including_sys_socket_h
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
138 # undef listen
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
139 # define listen listen_used_without_including_sys_socket_h
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
140 # undef recv
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
141 # define recv recv_used_without_including_sys_socket_h
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
142 # undef send
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
143 # define send send_used_without_including_sys_socket_h
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
144 # undef recvfrom
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
145 # define recvfrom recvfrom_used_without_including_sys_socket_h
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
146 # undef sendto
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
147 # define sendto sendto_used_without_including_sys_socket_h
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
148 # undef setsockopt
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
149 # define setsockopt setsockopt_used_without_including_sys_socket_h
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
150 # undef shutdown
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
151 # define shutdown shutdown_used_without_including_sys_socket_h
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
152 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
153 _GL_WARN_ON_USE (socket,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
154 "socket() used without including <sys/socket.h>");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
155 _GL_WARN_ON_USE (connect,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
156 "connect() used without including <sys/socket.h>");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
157 _GL_WARN_ON_USE (accept,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
158 "accept() used without including <sys/socket.h>");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
159 _GL_WARN_ON_USE (bind,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
160 "bind() used without including <sys/socket.h>");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
161 _GL_WARN_ON_USE (getpeername,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
162 "getpeername() used without including <sys/socket.h>");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
163 _GL_WARN_ON_USE (getsockname,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
164 "getsockname() used without including <sys/socket.h>");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
165 _GL_WARN_ON_USE (getsockopt,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
166 "getsockopt() used without including <sys/socket.h>");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
167 _GL_WARN_ON_USE (listen,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
168 "listen() used without including <sys/socket.h>");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
169 _GL_WARN_ON_USE (recv,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
170 "recv() used without including <sys/socket.h>");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
171 _GL_WARN_ON_USE (send,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
172 "send() used without including <sys/socket.h>");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
173 _GL_WARN_ON_USE (recvfrom,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
174 "recvfrom() used without including <sys/socket.h>");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
175 _GL_WARN_ON_USE (sendto,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
176 "sendto() used without including <sys/socket.h>");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
177 _GL_WARN_ON_USE (setsockopt,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
178 "setsockopt() used without including <sys/socket.h>");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
179 _GL_WARN_ON_USE (shutdown,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
180 "shutdown() used without including <sys/socket.h>");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
181 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
182 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
183 # if !defined _GL_SYS_SELECT_H
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
184 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
185 # undef select
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
186 # define select select_used_without_including_sys_select_h
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
187 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
188 _GL_WARN_ON_USE (select,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
189 "select() used without including <sys/select.h>");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
190 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
191 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
192 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
193 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
194
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
195
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
196 /* OS/2 EMX lacks these macros. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
197 #ifndef STDIN_FILENO
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
198 # define STDIN_FILENO 0
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
199 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
200 #ifndef STDOUT_FILENO
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
201 # define STDOUT_FILENO 1
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
202 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
203 #ifndef STDERR_FILENO
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
204 # define STDERR_FILENO 2
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
205 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
206
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
207 /* Ensure *_OK macros exist. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
208 #ifndef F_OK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
209 # define F_OK 0
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
210 # define X_OK 1
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
211 # define W_OK 2
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
212 # define R_OK 4
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
213 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
214
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
215
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
216 /* Declare overridden functions. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
217
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
218
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
219 #if defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
220 /* The access() function is a security risk. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
221 _GL_WARN_ON_USE (access, "the access function is a security risk - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
222 "use the gnulib module faccessat instead");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
223 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
224
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
225
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
226 #if @GNULIB_CHOWN@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
227 /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
228 to GID (if GID is not -1). Follow symbolic links.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
229 Return 0 if successful, otherwise -1 and errno set.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
230 See the POSIX:2001 specification
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
231 <http://www.opengroup.org/susv3xsh/chown.html>. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
232 # if @REPLACE_CHOWN@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
233 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
234 # undef chown
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
235 # define chown rpl_chown
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
236 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
237 _GL_FUNCDECL_RPL (chown, int, (const char *file, uid_t uid, gid_t gid)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
238 _GL_ARG_NONNULL ((1)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
239 _GL_CXXALIAS_RPL (chown, int, (const char *file, uid_t uid, gid_t gid));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
240 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
241 # if !@HAVE_CHOWN@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
242 _GL_FUNCDECL_SYS (chown, int, (const char *file, uid_t uid, gid_t gid)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
243 _GL_ARG_NONNULL ((1)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
244 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
245 _GL_CXXALIAS_SYS (chown, int, (const char *file, uid_t uid, gid_t gid));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
246 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
247 _GL_CXXALIASWARN (chown);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
248 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
249 # undef chown
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
250 # if HAVE_RAW_DECL_CHOWN
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
251 _GL_WARN_ON_USE (chown, "chown fails to follow symlinks on some systems and "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
252 "doesn't treat a uid or gid of -1 on some systems - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
253 "use gnulib module chown for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
254 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
255 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
256
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
257
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
258 #if @GNULIB_CLOSE@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
259 # if @REPLACE_CLOSE@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
260 /* Automatically included by modules that need a replacement for close. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
261 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
262 # undef close
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
263 # define close rpl_close
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
264 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
265 _GL_FUNCDECL_RPL (close, int, (int fd));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
266 _GL_CXXALIAS_RPL (close, int, (int fd));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
267 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
268 _GL_CXXALIAS_SYS (close, int, (int fd));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
269 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
270 _GL_CXXALIASWARN (close);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
271 #elif @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
272 # undef close
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
273 # define close close_used_without_requesting_gnulib_module_close
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
274 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
275 # undef close
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
276 /* Assume close is always declared. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
277 _GL_WARN_ON_USE (close, "close does not portably work on sockets - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
278 "use gnulib module close for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
279 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
280
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
281
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
282 #if @REPLACE_DUP@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
283 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
284 # define dup rpl_dup
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
285 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
286 _GL_FUNCDECL_RPL (dup, int, (int oldfd));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
287 _GL_CXXALIAS_RPL (dup, int, (int oldfd));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
288 #else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
289 _GL_CXXALIAS_SYS (dup, int, (int oldfd));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
290 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
291 _GL_CXXALIASWARN (dup);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
292
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
293
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
294 #if @GNULIB_DUP2@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
295 /* Copy the file descriptor OLDFD into file descriptor NEWFD. Do nothing if
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
296 NEWFD = OLDFD, otherwise close NEWFD first if it is open.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
297 Return newfd if successful, otherwise -1 and errno set.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
298 See the POSIX:2001 specification
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
299 <http://www.opengroup.org/susv3xsh/dup2.html>. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
300 # if @REPLACE_DUP2@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
301 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
302 # define dup2 rpl_dup2
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
303 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
304 _GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
305 _GL_CXXALIAS_RPL (dup2, int, (int oldfd, int newfd));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
306 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
307 # if !@HAVE_DUP2@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
308 _GL_FUNCDECL_SYS (dup2, int, (int oldfd, int newfd));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
309 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
310 _GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
311 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
312 _GL_CXXALIASWARN (dup2);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
313 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
314 # undef dup2
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
315 # if HAVE_RAW_DECL_DUP2
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
316 _GL_WARN_ON_USE (dup2, "dup2 is unportable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
317 "use gnulib module dup2 for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
318 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
319 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
320
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
321
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
322 #if @GNULIB_DUP3@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
323 /* Copy the file descriptor OLDFD into file descriptor NEWFD, with the
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
324 specified flags.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
325 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
326 and O_TEXT, O_BINARY (defined in "binary-io.h").
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
327 Close NEWFD first if it is open.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
328 Return newfd if successful, otherwise -1 and errno set.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
329 See the Linux man page at
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
330 <http://www.kernel.org/doc/man-pages/online/pages/man2/dup3.2.html>. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
331 # if @HAVE_DUP3@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
332 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
333 # define dup3 rpl_dup3
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
334 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
335 _GL_FUNCDECL_RPL (dup3, int, (int oldfd, int newfd, int flags));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
336 _GL_CXXALIAS_RPL (dup3, int, (int oldfd, int newfd, int flags));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
337 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
338 _GL_FUNCDECL_SYS (dup3, int, (int oldfd, int newfd, int flags));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
339 _GL_CXXALIAS_SYS (dup3, int, (int oldfd, int newfd, int flags));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
340 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
341 _GL_CXXALIASWARN (dup3);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
342 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
343 # undef dup3
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
344 # if HAVE_RAW_DECL_DUP3
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
345 _GL_WARN_ON_USE (dup3, "dup3 is unportable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
346 "use gnulib module dup3 for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
347 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
348 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
349
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
350
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
351 #if @GNULIB_ENVIRON@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
352 # if !@HAVE_DECL_ENVIRON@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
353 /* Set of environment variables and values. An array of strings of the form
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
354 "VARIABLE=VALUE", terminated with a NULL. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
355 # if defined __APPLE__ && defined __MACH__
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
356 # include <crt_externs.h>
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
357 # define environ (*_NSGetEnviron ())
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
358 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
359 # ifdef __cplusplus
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
360 extern "C" {
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
361 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
362 extern char **environ;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
363 # ifdef __cplusplus
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
364 }
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
365 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
366 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
367 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
368 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
369 # if HAVE_RAW_DECL_ENVIRON
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
370 static inline char ***
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
371 rpl_environ (void)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
372 {
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
373 return &environ;
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
374 }
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
375 _GL_WARN_ON_USE (rpl_environ, "environ is unportable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
376 "use gnulib module environ for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
377 # undef environ
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
378 # define environ (*rpl_environ ())
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
379 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
380 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
381
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
382
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
383 #if @GNULIB_EUIDACCESS@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
384 /* Like access(), except that it uses the effective user id and group id of
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
385 the current process. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
386 # if !@HAVE_EUIDACCESS@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
387 _GL_FUNCDECL_SYS (euidaccess, int, (const char *filename, int mode)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
388 _GL_ARG_NONNULL ((1)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
389 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
390 _GL_CXXALIAS_SYS (euidaccess, int, (const char *filename, int mode));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
391 _GL_CXXALIASWARN (euidaccess);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
392 # if defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
393 /* Like access(), this function is a security risk. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
394 _GL_WARN_ON_USE (euidaccess, "the euidaccess function is a security risk - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
395 "use the gnulib module faccessat instead");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
396 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
397 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
398 # undef euidaccess
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
399 # if HAVE_RAW_DECL_EUIDACCESS
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
400 _GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
401 "use gnulib module euidaccess for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
402 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
403 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
404
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
405
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
406 #if @GNULIB_FACCESSAT@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
407 # if !@HAVE_FACCESSAT@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
408 _GL_FUNCDECL_SYS (faccessat, int,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
409 (int fd, char const *file, int mode, int flag)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
410 _GL_ARG_NONNULL ((2)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
411 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
412 _GL_CXXALIAS_SYS (faccessat, int,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
413 (int fd, char const *file, int mode, int flag));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
414 _GL_CXXALIASWARN (faccessat);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
415 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
416 # undef faccessat
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
417 # if HAVE_RAW_DECL_FACCESSAT
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
418 _GL_WARN_ON_USE (faccessat, "faccessat is not portable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
419 "use gnulib module faccessat for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
420 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
421 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
422
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
423
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
424 #if @GNULIB_FCHDIR@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
425 /* Change the process' current working directory to the directory on which
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
426 the given file descriptor is open.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
427 Return 0 if successful, otherwise -1 and errno set.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
428 See the POSIX:2001 specification
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
429 <http://www.opengroup.org/susv3xsh/fchdir.html>. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
430 # if ! @HAVE_FCHDIR@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
431 _GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
432
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
433 /* Gnulib internal hooks needed to maintain the fchdir metadata. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
434 _GL_EXTERN_C int _gl_register_fd (int fd, const char *filename)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
435 _GL_ARG_NONNULL ((2));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
436 _GL_EXTERN_C void _gl_unregister_fd (int fd);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
437 _GL_EXTERN_C int _gl_register_dup (int oldfd, int newfd);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
438 _GL_EXTERN_C const char *_gl_directory_name (int fd);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
439
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
440 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
441 # if !@HAVE_DECL_FCHDIR@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
442 _GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
443 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
444 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
445 _GL_CXXALIAS_SYS (fchdir, int, (int /*fd*/));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
446 _GL_CXXALIASWARN (fchdir);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
447 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
448 # undef fchdir
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
449 # if HAVE_RAW_DECL_FCHDIR
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
450 _GL_WARN_ON_USE (fchdir, "fchdir is unportable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
451 "use gnulib module fchdir for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
452 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
453 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
454
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
455
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
456 #if @GNULIB_FCHOWNAT@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
457 # if @REPLACE_FCHOWNAT@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
458 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
459 # undef fchownat
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
460 # define fchownat rpl_fchownat
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
461 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
462 _GL_FUNCDECL_RPL (fchownat, int, (int fd, char const *file,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
463 uid_t owner, gid_t group, int flag)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
464 _GL_ARG_NONNULL ((2)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
465 _GL_CXXALIAS_RPL (fchownat, int, (int fd, char const *file,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
466 uid_t owner, gid_t group, int flag));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
467 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
468 # if !@HAVE_FCHOWNAT@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
469 _GL_FUNCDECL_SYS (fchownat, int, (int fd, char const *file,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
470 uid_t owner, gid_t group, int flag)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
471 _GL_ARG_NONNULL ((2)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
472 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
473 _GL_CXXALIAS_SYS (fchownat, int, (int fd, char const *file,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
474 uid_t owner, gid_t group, int flag));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
475 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
476 _GL_CXXALIASWARN (fchownat);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
477 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
478 # undef fchownat
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
479 # if HAVE_RAW_DECL_FCHOWNAT
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
480 _GL_WARN_ON_USE (fchownat, "fchownat is not portable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
481 "use gnulib module openat for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
482 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
483 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
484
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
485
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
486 #if @GNULIB_FSYNC@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
487 /* Synchronize changes to a file.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
488 Return 0 if successful, otherwise -1 and errno set.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
489 See POSIX:2001 specification
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
490 <http://www.opengroup.org/susv3xsh/fsync.html>. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
491 # if !@HAVE_FSYNC@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
492 _GL_FUNCDECL_SYS (fsync, int, (int fd));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
493 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
494 _GL_CXXALIAS_SYS (fsync, int, (int fd));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
495 _GL_CXXALIASWARN (fsync);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
496 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
497 # undef fsync
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
498 # if HAVE_RAW_DECL_FSYNC
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
499 _GL_WARN_ON_USE (fsync, "fsync is unportable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
500 "use gnulib module fsync for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
501 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
502 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
503
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
504
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
505 #if @GNULIB_FTRUNCATE@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
506 /* Change the size of the file to which FD is opened to become equal to LENGTH.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
507 Return 0 if successful, otherwise -1 and errno set.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
508 See the POSIX:2001 specification
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
509 <http://www.opengroup.org/susv3xsh/ftruncate.html>. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
510 # if !@HAVE_FTRUNCATE@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
511 _GL_FUNCDECL_SYS (ftruncate, int, (int fd, off_t length));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
512 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
513 _GL_CXXALIAS_SYS (ftruncate, int, (int fd, off_t length));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
514 _GL_CXXALIASWARN (ftruncate);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
515 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
516 # undef ftruncate
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
517 # if HAVE_RAW_DECL_FTRUNCATE
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
518 _GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
519 "use gnulib module ftruncate for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
520 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
521 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
522
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
523
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
524 #if @GNULIB_GETCWD@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
525 /* Get the name of the current working directory, and put it in SIZE bytes
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
526 of BUF.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
527 Return BUF if successful, or NULL if the directory couldn't be determined
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
528 or SIZE was too small.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
529 See the POSIX:2001 specification
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
530 <http://www.opengroup.org/susv3xsh/getcwd.html>.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
531 Additionally, the gnulib module 'getcwd' guarantees the following GNU
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
532 extension: If BUF is NULL, an array is allocated with 'malloc'; the array
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
533 is SIZE bytes long, unless SIZE == 0, in which case it is as big as
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
534 necessary. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
535 # if @REPLACE_GETCWD@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
536 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
537 # define getcwd rpl_getcwd
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
538 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
539 _GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
540 _GL_CXXALIAS_RPL (getcwd, char *, (char *buf, size_t size));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
541 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
542 /* Need to cast, because on mingw, the second parameter is
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
543 int size. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
544 _GL_CXXALIAS_SYS_CAST (getcwd, char *, (char *buf, size_t size));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
545 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
546 _GL_CXXALIASWARN (getcwd);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
547 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
548 # undef getcwd
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
549 # if HAVE_RAW_DECL_GETCWD
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
550 _GL_WARN_ON_USE (getcwd, "getcwd is unportable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
551 "use gnulib module getcwd for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
552 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
553 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
554
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
555
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
556 #if @GNULIB_GETDOMAINNAME@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
557 /* Return the NIS domain name of the machine.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
558 WARNING! The NIS domain name is unrelated to the fully qualified host name
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
559 of the machine. It is also unrelated to email addresses.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
560 WARNING! The NIS domain name is usually the empty string or "(none)" when
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
561 not using NIS.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
562
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
563 Put up to LEN bytes of the NIS domain name into NAME.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
564 Null terminate it if the name is shorter than LEN.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
565 If the NIS domain name is longer than LEN, set errno = EINVAL and return -1.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
566 Return 0 if successful, otherwise set errno and return -1. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
567 # if @REPLACE_GETDOMAINNAME@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
568 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
569 # undef getdomainname
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
570 # define getdomainname rpl_getdomainname
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
571 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
572 _GL_FUNCDECL_RPL (getdomainname, int, (char *name, size_t len)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
573 _GL_ARG_NONNULL ((1)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
574 _GL_CXXALIAS_RPL (getdomainname, int, (char *name, size_t len));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
575 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
576 # if !@HAVE_DECL_GETDOMAINNAME@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
577 _GL_FUNCDECL_SYS (getdomainname, int, (char *name, size_t len)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
578 _GL_ARG_NONNULL ((1)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
579 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
580 _GL_CXXALIAS_SYS (getdomainname, int, (char *name, size_t len));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
581 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
582 _GL_CXXALIASWARN (getdomainname);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
583 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
584 # undef getdomainname
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
585 # if HAVE_RAW_DECL_GETDOMAINNAME
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
586 _GL_WARN_ON_USE (getdomainname, "getdomainname is unportable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
587 "use gnulib module getdomainname for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
588 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
589 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
590
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
591
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
592 #if @GNULIB_GETDTABLESIZE@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
593 /* Return the maximum number of file descriptors in the current process.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
594 In POSIX, this is same as sysconf (_SC_OPEN_MAX). */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
595 # if !@HAVE_GETDTABLESIZE@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
596 _GL_FUNCDECL_SYS (getdtablesize, int, (void));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
597 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
598 _GL_CXXALIAS_SYS (getdtablesize, int, (void));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
599 _GL_CXXALIASWARN (getdtablesize);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
600 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
601 # undef getdtablesize
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
602 # if HAVE_RAW_DECL_GETDTABLESIZE
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
603 _GL_WARN_ON_USE (getdtablesize, "getdtablesize is unportable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
604 "use gnulib module getdtablesize for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
605 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
606 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
607
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
608
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
609 #if @GNULIB_GETGROUPS@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
610 /* Return the supplemental groups that the current process belongs to.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
611 It is unspecified whether the effective group id is in the list.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
612 If N is 0, return the group count; otherwise, N describes how many
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
613 entries are available in GROUPS. Return -1 and set errno if N is
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
614 not 0 and not large enough. Fails with ENOSYS on some systems. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
615 # if @REPLACE_GETGROUPS@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
616 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
617 # undef getgroups
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
618 # define getgroups rpl_getgroups
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
619 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
620 _GL_FUNCDECL_RPL (getgroups, int, (int n, gid_t *groups));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
621 _GL_CXXALIAS_RPL (getgroups, int, (int n, gid_t *groups));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
622 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
623 # if !@HAVE_GETGROUPS@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
624 _GL_FUNCDECL_SYS (getgroups, int, (int n, gid_t *groups));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
625 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
626 _GL_CXXALIAS_SYS (getgroups, int, (int n, gid_t *groups));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
627 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
628 _GL_CXXALIASWARN (getgroups);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
629 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
630 # undef getgroups
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
631 # if HAVE_RAW_DECL_GETGROUPS
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
632 _GL_WARN_ON_USE (getgroups, "getgroups is unportable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
633 "use gnulib module getgroups for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
634 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
635 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
636
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
637
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
638 #if @GNULIB_GETHOSTNAME@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
639 /* Return the standard host name of the machine.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
640 WARNING! The host name may or may not be fully qualified.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
641
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
642 Put up to LEN bytes of the host name into NAME.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
643 Null terminate it if the name is shorter than LEN.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
644 If the host name is longer than LEN, set errno = EINVAL and return -1.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
645 Return 0 if successful, otherwise set errno and return -1. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
646 # if @UNISTD_H_HAVE_WINSOCK2_H@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
647 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
648 # undef gethostname
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
649 # define gethostname rpl_gethostname
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
650 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
651 _GL_FUNCDECL_RPL (gethostname, int, (char *name, size_t len)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
652 _GL_ARG_NONNULL ((1)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
653 _GL_CXXALIAS_RPL (gethostname, int, (char *name, size_t len));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
654 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
655 # if !@HAVE_GETHOSTNAME@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
656 _GL_FUNCDECL_SYS (gethostname, int, (char *name, size_t len)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
657 _GL_ARG_NONNULL ((1)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
658 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
659 /* Need to cast, because on Solaris 10 and OSF/1 5.1 systems, the second
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
660 parameter is
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
661 int len. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
662 _GL_CXXALIAS_SYS_CAST (gethostname, int, (char *name, size_t len));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
663 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
664 _GL_CXXALIASWARN (gethostname);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
665 #elif @UNISTD_H_HAVE_WINSOCK2_H@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
666 # undef gethostname
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
667 # define gethostname gethostname_used_without_requesting_gnulib_module_gethostname
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
668 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
669 # undef gethostname
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
670 # if HAVE_RAW_DECL_GETHOSTNAME
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
671 _GL_WARN_ON_USE (gethostname, "gethostname is unportable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
672 "use gnulib module gethostname for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
673 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
674 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
675
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
676
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
677 #if @GNULIB_GETLOGIN@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
678 /* Returns the user's login name, or NULL if it cannot be found. Upon error,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
679 returns NULL with errno set.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
680
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
681 See <http://www.opengroup.org/susv3xsh/getlogin.html>.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
682
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
683 Most programs don't need to use this function, because the information is
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
684 available through environment variables:
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
685 ${LOGNAME-$USER} on Unix platforms,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
686 $USERNAME on native Windows platforms.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
687 */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
688 # if !@HAVE_GETLOGIN@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
689 _GL_FUNCDECL_SYS (getlogin, char *, (void));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
690 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
691 _GL_CXXALIAS_SYS (getlogin, char *, (void));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
692 _GL_CXXALIASWARN (getlogin);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
693 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
694 # undef getlogin
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
695 # if HAVE_RAW_DECL_GETLOGIN
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
696 _GL_WARN_ON_USE (getlogin, "getlogin is unportable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
697 "use gnulib module getlogin for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
698 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
699 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
700
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
701
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
702 #if @GNULIB_GETLOGIN_R@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
703 /* Copies the user's login name to NAME.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
704 The array pointed to by NAME has room for SIZE bytes.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
705
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
706 Returns 0 if successful. Upon error, an error number is returned, or -1 in
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
707 the case that the login name cannot be found but no specific error is
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
708 provided (this case is hopefully rare but is left open by the POSIX spec).
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
709
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
710 See <http://www.opengroup.org/susv3xsh/getlogin.html>.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
711
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
712 Most programs don't need to use this function, because the information is
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
713 available through environment variables:
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
714 ${LOGNAME-$USER} on Unix platforms,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
715 $USERNAME on native Windows platforms.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
716 */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
717 # if @REPLACE_GETLOGIN_R@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
718 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
719 # define getlogin_r rpl_getlogin_r
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
720 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
721 _GL_FUNCDECL_RPL (getlogin_r, int, (char *name, size_t size)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
722 _GL_ARG_NONNULL ((1)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
723 _GL_CXXALIAS_RPL (getlogin_r, int, (char *name, size_t size));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
724 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
725 # if !@HAVE_DECL_GETLOGIN_R@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
726 _GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
727 _GL_ARG_NONNULL ((1)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
728 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
729 /* Need to cast, because on Solaris 10 systems, the second argument is
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
730 int size. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
731 _GL_CXXALIAS_SYS_CAST (getlogin_r, int, (char *name, size_t size));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
732 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
733 _GL_CXXALIASWARN (getlogin_r);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
734 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
735 # undef getlogin_r
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
736 # if HAVE_RAW_DECL_GETLOGIN_R
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
737 _GL_WARN_ON_USE (getlogin_r, "getlogin_r is unportable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
738 "use gnulib module getlogin_r for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
739 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
740 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
741
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
742
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
743 #if @GNULIB_GETPAGESIZE@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
744 # if @REPLACE_GETPAGESIZE@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
745 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
746 # define getpagesize rpl_getpagesize
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
747 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
748 _GL_FUNCDECL_RPL (getpagesize, int, (void));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
749 _GL_CXXALIAS_RPL (getpagesize, int, (void));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
750 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
751 # if !@HAVE_GETPAGESIZE@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
752 # if !defined getpagesize
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
753 /* This is for POSIX systems. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
754 # if !defined _gl_getpagesize && defined _SC_PAGESIZE
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
755 # if ! (defined __VMS && __VMS_VER < 70000000)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
756 # define _gl_getpagesize() sysconf (_SC_PAGESIZE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
757 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
758 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
759 /* This is for older VMS. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
760 # if !defined _gl_getpagesize && defined __VMS
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
761 # ifdef __ALPHA
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
762 # define _gl_getpagesize() 8192
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
763 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
764 # define _gl_getpagesize() 512
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
765 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
766 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
767 /* This is for BeOS. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
768 # if !defined _gl_getpagesize && @HAVE_OS_H@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
769 # include <OS.h>
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
770 # if defined B_PAGE_SIZE
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
771 # define _gl_getpagesize() B_PAGE_SIZE
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
772 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
773 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
774 /* This is for AmigaOS4.0. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
775 # if !defined _gl_getpagesize && defined __amigaos4__
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
776 # define _gl_getpagesize() 2048
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
777 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
778 /* This is for older Unix systems. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
779 # if !defined _gl_getpagesize && @HAVE_SYS_PARAM_H@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
780 # include <sys/param.h>
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
781 # ifdef EXEC_PAGESIZE
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
782 # define _gl_getpagesize() EXEC_PAGESIZE
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
783 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
784 # ifdef NBPG
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
785 # ifndef CLSIZE
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
786 # define CLSIZE 1
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
787 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
788 # define _gl_getpagesize() (NBPG * CLSIZE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
789 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
790 # ifdef NBPC
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
791 # define _gl_getpagesize() NBPC
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
792 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
793 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
794 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
795 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
796 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
797 # define getpagesize() _gl_getpagesize ()
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
798 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
799 static inline int
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
800 getpagesize ()
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
801 {
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
802 return _gl_getpagesize ();
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
803 }
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
804 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
805 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
806 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
807 /* Need to cast, because on Cygwin 1.5.x systems, the return type is size_t. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
808 _GL_CXXALIAS_SYS_CAST (getpagesize, int, (void));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
809 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
810 # if @HAVE_DECL_GETPAGESIZE@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
811 _GL_CXXALIASWARN (getpagesize);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
812 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
813 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
814 # undef getpagesize
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
815 # if HAVE_RAW_DECL_GETPAGESIZE
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
816 _GL_WARN_ON_USE (getpagesize, "getpagesize is unportable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
817 "use gnulib module getpagesize for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
818 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
819 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
820
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
821
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
822 #if @GNULIB_GETUSERSHELL@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
823 /* Return the next valid login shell on the system, or NULL when the end of
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
824 the list has been reached. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
825 # if !@HAVE_DECL_GETUSERSHELL@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
826 _GL_FUNCDECL_SYS (getusershell, char *, (void));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
827 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
828 _GL_CXXALIAS_SYS (getusershell, char *, (void));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
829 _GL_CXXALIASWARN (getusershell);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
830 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
831 # undef getusershell
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
832 # if HAVE_RAW_DECL_GETUSERSHELL
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
833 _GL_WARN_ON_USE (getusershell, "getusershell is unportable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
834 "use gnulib module getusershell for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
835 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
836 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
837
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
838 #if @GNULIB_GETUSERSHELL@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
839 /* Rewind to pointer that is advanced at each getusershell() call. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
840 # if !@HAVE_DECL_GETUSERSHELL@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
841 _GL_FUNCDECL_SYS (setusershell, void, (void));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
842 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
843 _GL_CXXALIAS_SYS (setusershell, void, (void));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
844 _GL_CXXALIASWARN (setusershell);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
845 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
846 # undef setusershell
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
847 # if HAVE_RAW_DECL_SETUSERSHELL
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
848 _GL_WARN_ON_USE (setusershell, "setusershell is unportable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
849 "use gnulib module getusershell for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
850 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
851 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
852
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
853 #if @GNULIB_GETUSERSHELL@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
854 /* Free the pointer that is advanced at each getusershell() call and
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
855 associated resources. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
856 # if !@HAVE_DECL_GETUSERSHELL@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
857 _GL_FUNCDECL_SYS (endusershell, void, (void));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
858 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
859 _GL_CXXALIAS_SYS (endusershell, void, (void));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
860 _GL_CXXALIASWARN (endusershell);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
861 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
862 # undef endusershell
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
863 # if HAVE_RAW_DECL_ENDUSERSHELL
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
864 _GL_WARN_ON_USE (endusershell, "endusershell is unportable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
865 "use gnulib module getusershell for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
866 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
867 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
868
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
869
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
870 #if @GNULIB_LCHOWN@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
871 /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
872 to GID (if GID is not -1). Do not follow symbolic links.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
873 Return 0 if successful, otherwise -1 and errno set.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
874 See the POSIX:2001 specification
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
875 <http://www.opengroup.org/susv3xsh/lchown.html>. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
876 # if @REPLACE_LCHOWN@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
877 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
878 # undef lchown
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
879 # define lchown rpl_lchown
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
880 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
881 _GL_FUNCDECL_RPL (lchown, int, (char const *file, uid_t owner, gid_t group)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
882 _GL_ARG_NONNULL ((1)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
883 _GL_CXXALIAS_RPL (lchown, int, (char const *file, uid_t owner, gid_t group));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
884 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
885 # if !@HAVE_LCHOWN@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
886 _GL_FUNCDECL_SYS (lchown, int, (char const *file, uid_t owner, gid_t group)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
887 _GL_ARG_NONNULL ((1)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
888 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
889 _GL_CXXALIAS_SYS (lchown, int, (char const *file, uid_t owner, gid_t group));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
890 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
891 _GL_CXXALIASWARN (lchown);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
892 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
893 # undef lchown
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
894 # if HAVE_RAW_DECL_LCHOWN
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
895 _GL_WARN_ON_USE (lchown, "lchown is unportable to pre-POSIX.1-2001 systems - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
896 "use gnulib module lchown for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
897 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
898 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
899
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
900
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
901 #if @GNULIB_LINK@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
902 /* Create a new hard link for an existing file.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
903 Return 0 if successful, otherwise -1 and errno set.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
904 See POSIX:2001 specification
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
905 <http://www.opengroup.org/susv3xsh/link.html>. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
906 # if @REPLACE_LINK@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
907 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
908 # define link rpl_link
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
909 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
910 _GL_FUNCDECL_RPL (link, int, (const char *path1, const char *path2)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
911 _GL_ARG_NONNULL ((1, 2)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
912 _GL_CXXALIAS_RPL (link, int, (const char *path1, const char *path2));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
913 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
914 # if !@HAVE_LINK@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
915 _GL_FUNCDECL_SYS (link, int, (const char *path1, const char *path2)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
916 _GL_ARG_NONNULL ((1, 2)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
917 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
918 _GL_CXXALIAS_SYS (link, int, (const char *path1, const char *path2));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
919 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
920 _GL_CXXALIASWARN (link);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
921 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
922 # undef link
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
923 # if HAVE_RAW_DECL_LINK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
924 _GL_WARN_ON_USE (link, "link is unportable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
925 "use gnulib module link for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
926 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
927 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
928
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
929
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
930 #if @GNULIB_LINKAT@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
931 /* Create a new hard link for an existing file, relative to two
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
932 directories. FLAG controls whether symlinks are followed.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
933 Return 0 if successful, otherwise -1 and errno set. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
934 # if @REPLACE_LINKAT@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
935 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
936 # undef linkat
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
937 # define linkat rpl_linkat
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
938 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
939 _GL_FUNCDECL_RPL (linkat, int,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
940 (int fd1, const char *path1, int fd2, const char *path2,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
941 int flag)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
942 _GL_ARG_NONNULL ((2, 4)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
943 _GL_CXXALIAS_RPL (linkat, int,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
944 (int fd1, const char *path1, int fd2, const char *path2,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
945 int flag));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
946 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
947 # if !@HAVE_LINKAT@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
948 _GL_FUNCDECL_SYS (linkat, int,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
949 (int fd1, const char *path1, int fd2, const char *path2,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
950 int flag)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
951 _GL_ARG_NONNULL ((2, 4)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
952 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
953 _GL_CXXALIAS_SYS (linkat, int,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
954 (int fd1, const char *path1, int fd2, const char *path2,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
955 int flag));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
956 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
957 _GL_CXXALIASWARN (linkat);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
958 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
959 # undef linkat
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
960 # if HAVE_RAW_DECL_LINKAT
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
961 _GL_WARN_ON_USE (linkat, "linkat is unportable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
962 "use gnulib module linkat for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
963 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
964 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
965
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
966
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
967 #if @GNULIB_LSEEK@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
968 /* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
969 Return the new offset if successful, otherwise -1 and errno set.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
970 See the POSIX:2001 specification
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
971 <http://www.opengroup.org/susv3xsh/lseek.html>. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
972 # if @REPLACE_LSEEK@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
973 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
974 # define lseek rpl_lseek
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
975 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
976 _GL_FUNCDECL_RPL (lseek, off_t, (int fd, off_t offset, int whence));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
977 _GL_CXXALIAS_RPL (lseek, off_t, (int fd, off_t offset, int whence));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
978 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
979 _GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
980 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
981 _GL_CXXALIASWARN (lseek);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
982 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
983 # undef lseek
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
984 # if HAVE_RAW_DECL_LSEEK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
985 _GL_WARN_ON_USE (lseek, "lseek does not fail with ESPIPE on pipes on some "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
986 "systems - use gnulib module lseek for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
987 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
988 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
989
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
990
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
991 #if @GNULIB_PIPE@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
992 /* Create a pipe, defaulting to O_BINARY mode.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
993 Store the read-end as fd[0] and the write-end as fd[1].
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
994 Return 0 upon success, or -1 with errno set upon failure. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
995 # if !@HAVE_PIPE@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
996 _GL_FUNCDECL_SYS (pipe, int, (int fd[2]) _GL_ARG_NONNULL ((1)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
997 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
998 _GL_CXXALIAS_SYS (pipe, int, (int fd[2]));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
999 _GL_CXXALIASWARN (pipe);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1000 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1001 # undef pipe
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1002 # if HAVE_RAW_DECL_PIPE
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1003 _GL_WARN_ON_USE (pipe, "pipe is unportable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1004 "use gnulib module pipe-posix for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1005 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1006 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1007
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1008
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1009 #if @GNULIB_PIPE2@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1010 /* Create a pipe, applying the given flags when opening the read-end of the
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1011 pipe and the write-end of the pipe.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1012 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1013 and O_TEXT, O_BINARY (defined in "binary-io.h").
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1014 Store the read-end as fd[0] and the write-end as fd[1].
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1015 Return 0 upon success, or -1 with errno set upon failure.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1016 See also the Linux man page at
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1017 <http://www.kernel.org/doc/man-pages/online/pages/man2/pipe2.2.html>. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1018 # if @HAVE_PIPE2@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1019 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1020 # define pipe2 rpl_pipe2
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1021 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1022 _GL_FUNCDECL_RPL (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1023 _GL_CXXALIAS_RPL (pipe2, int, (int fd[2], int flags));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1024 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1025 _GL_FUNCDECL_SYS (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1026 _GL_CXXALIAS_SYS (pipe2, int, (int fd[2], int flags));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1027 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1028 _GL_CXXALIASWARN (pipe2);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1029 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1030 # undef pipe2
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1031 # if HAVE_RAW_DECL_PIPE2
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1032 _GL_WARN_ON_USE (pipe2, "pipe2 is unportable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1033 "use gnulib module pipe2 for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1034 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1035 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1036
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1037
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1038 #if @GNULIB_PREAD@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1039 /* Read at most BUFSIZE bytes from FD into BUF, starting at OFFSET.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1040 Return the number of bytes placed into BUF if successful, otherwise
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1041 set errno and return -1. 0 indicates EOF. See the POSIX:2001
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1042 specification <http://www.opengroup.org/susv3xsh/pread.html>. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1043 # if @REPLACE_PREAD@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1044 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1045 # define pread rpl_pread
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1046 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1047 _GL_FUNCDECL_RPL (pread, ssize_t,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1048 (int fd, void *buf, size_t bufsize, off_t offset)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1049 _GL_ARG_NONNULL ((2)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1050 _GL_CXXALIAS_RPL (pread, ssize_t,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1051 (int fd, void *buf, size_t bufsize, off_t offset));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1052 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1053 # if !@HAVE_PREAD@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1054 _GL_FUNCDECL_SYS (pread, ssize_t,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1055 (int fd, void *buf, size_t bufsize, off_t offset)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1056 _GL_ARG_NONNULL ((2)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1057 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1058 _GL_CXXALIAS_SYS (pread, ssize_t,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1059 (int fd, void *buf, size_t bufsize, off_t offset));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1060 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1061 _GL_CXXALIASWARN (pread);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1062 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1063 # undef pread
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1064 # if HAVE_RAW_DECL_PREAD
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1065 _GL_WARN_ON_USE (pread, "pread is unportable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1066 "use gnulib module pread for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1067 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1068 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1069
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1070
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1071 #if @GNULIB_PWRITE@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1072 /* Write at most BUFSIZE bytes from BUF into FD, starting at OFFSET.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1073 Return the number of bytes written if successful, otherwise
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1074 set errno and return -1. 0 indicates nothing written. See the
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1075 POSIX:2001 specification
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1076 <http://www.opengroup.org/susv3xsh/pwrite.html>. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1077 # if @REPLACE_PWRITE@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1078 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1079 # define pwrite rpl_pwrite
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1080 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1081 _GL_FUNCDECL_RPL (pwrite, ssize_t,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1082 (int fd, const void *buf, size_t bufsize, off_t offset)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1083 _GL_ARG_NONNULL ((2)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1084 _GL_CXXALIAS_RPL (pwrite, ssize_t,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1085 (int fd, const void *buf, size_t bufsize, off_t offset));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1086 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1087 # if !@HAVE_PWRITE@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1088 _GL_FUNCDECL_SYS (pwrite, ssize_t,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1089 (int fd, const void *buf, size_t bufsize, off_t offset)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1090 _GL_ARG_NONNULL ((2)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1091 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1092 _GL_CXXALIAS_SYS (pwrite, ssize_t,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1093 (int fd, const void *buf, size_t bufsize, off_t offset));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1094 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1095 _GL_CXXALIASWARN (pwrite);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1096 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1097 # undef pwrite
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1098 # if HAVE_RAW_DECL_PWRITE
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1099 _GL_WARN_ON_USE (pwrite, "pwrite is unportable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1100 "use gnulib module pwrite for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1101 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1102 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1103
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1104
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1105 #if @GNULIB_READLINK@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1106 /* Read the contents of the symbolic link FILE and place the first BUFSIZE
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1107 bytes of it into BUF. Return the number of bytes placed into BUF if
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1108 successful, otherwise -1 and errno set.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1109 See the POSIX:2001 specification
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1110 <http://www.opengroup.org/susv3xsh/readlink.html>. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1111 # if @REPLACE_READLINK@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1112 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1113 # define readlink rpl_readlink
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1114 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1115 _GL_FUNCDECL_RPL (readlink, ssize_t,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1116 (const char *file, char *buf, size_t bufsize)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1117 _GL_ARG_NONNULL ((1, 2)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1118 _GL_CXXALIAS_RPL (readlink, ssize_t,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1119 (const char *file, char *buf, size_t bufsize));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1120 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1121 # if !@HAVE_READLINK@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1122 _GL_FUNCDECL_SYS (readlink, ssize_t,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1123 (const char *file, char *buf, size_t bufsize)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1124 _GL_ARG_NONNULL ((1, 2)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1125 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1126 _GL_CXXALIAS_SYS (readlink, ssize_t,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1127 (const char *file, char *buf, size_t bufsize));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1128 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1129 _GL_CXXALIASWARN (readlink);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1130 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1131 # undef readlink
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1132 # if HAVE_RAW_DECL_READLINK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1133 _GL_WARN_ON_USE (readlink, "readlink is unportable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1134 "use gnulib module readlink for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1135 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1136 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1137
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1138
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1139 #if @GNULIB_READLINKAT@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1140 # if !@HAVE_READLINKAT@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1141 _GL_FUNCDECL_SYS (readlinkat, ssize_t,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1142 (int fd, char const *file, char *buf, size_t len)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1143 _GL_ARG_NONNULL ((2, 3)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1144 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1145 _GL_CXXALIAS_SYS (readlinkat, ssize_t,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1146 (int fd, char const *file, char *buf, size_t len));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1147 _GL_CXXALIASWARN (readlinkat);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1148 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1149 # undef readlinkat
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1150 # if HAVE_RAW_DECL_READLINKAT
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1151 _GL_WARN_ON_USE (readlinkat, "readlinkat is not portable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1152 "use gnulib module readlinkat for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1153 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1154 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1155
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1156
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1157 #if @GNULIB_RMDIR@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1158 /* Remove the directory DIR. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1159 # if @REPLACE_RMDIR@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1160 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1161 # define rmdir rpl_rmdir
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1162 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1163 _GL_FUNCDECL_RPL (rmdir, int, (char const *name) _GL_ARG_NONNULL ((1)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1164 _GL_CXXALIAS_RPL (rmdir, int, (char const *name));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1165 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1166 _GL_CXXALIAS_SYS (rmdir, int, (char const *name));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1167 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1168 _GL_CXXALIASWARN (rmdir);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1169 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1170 # undef rmdir
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1171 # if HAVE_RAW_DECL_RMDIR
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1172 _GL_WARN_ON_USE (rmdir, "rmdir is unportable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1173 "use gnulib module rmdir for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1174 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1175 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1176
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1177
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1178 #if @GNULIB_SLEEP@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1179 /* Pause the execution of the current thread for N seconds.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1180 Returns the number of seconds left to sleep.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1181 See the POSIX:2001 specification
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1182 <http://www.opengroup.org/susv3xsh/sleep.html>. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1183 # if @REPLACE_SLEEP@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1184 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1185 # undef sleep
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1186 # define sleep rpl_sleep
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1187 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1188 _GL_FUNCDECL_RPL (sleep, unsigned int, (unsigned int n));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1189 _GL_CXXALIAS_RPL (sleep, unsigned int, (unsigned int n));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1190 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1191 # if !@HAVE_SLEEP@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1192 _GL_FUNCDECL_SYS (sleep, unsigned int, (unsigned int n));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1193 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1194 _GL_CXXALIAS_SYS (sleep, unsigned int, (unsigned int n));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1195 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1196 _GL_CXXALIASWARN (sleep);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1197 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1198 # undef sleep
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1199 # if HAVE_RAW_DECL_SLEEP
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1200 _GL_WARN_ON_USE (sleep, "sleep is unportable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1201 "use gnulib module sleep for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1202 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1203 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1204
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1205
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1206 #if @GNULIB_SYMLINK@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1207 # if @REPLACE_SYMLINK@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1208 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1209 # undef symlink
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1210 # define symlink rpl_symlink
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1211 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1212 _GL_FUNCDECL_RPL (symlink, int, (char const *contents, char const *file)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1213 _GL_ARG_NONNULL ((1, 2)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1214 _GL_CXXALIAS_RPL (symlink, int, (char const *contents, char const *file));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1215 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1216 # if !@HAVE_SYMLINK@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1217 _GL_FUNCDECL_SYS (symlink, int, (char const *contents, char const *file)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1218 _GL_ARG_NONNULL ((1, 2)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1219 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1220 _GL_CXXALIAS_SYS (symlink, int, (char const *contents, char const *file));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1221 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1222 _GL_CXXALIASWARN (symlink);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1223 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1224 # undef symlink
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1225 # if HAVE_RAW_DECL_SYMLINK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1226 _GL_WARN_ON_USE (symlink, "symlink is not portable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1227 "use gnulib module symlink for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1228 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1229 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1230
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1231
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1232 #if @GNULIB_SYMLINKAT@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1233 # if !@HAVE_SYMLINKAT@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1234 _GL_FUNCDECL_SYS (symlinkat, int,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1235 (char const *contents, int fd, char const *file)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1236 _GL_ARG_NONNULL ((1, 3)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1237 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1238 _GL_CXXALIAS_SYS (symlinkat, int,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1239 (char const *contents, int fd, char const *file));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1240 _GL_CXXALIASWARN (symlinkat);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1241 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1242 # undef symlinkat
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1243 # if HAVE_RAW_DECL_SYMLINKAT
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1244 _GL_WARN_ON_USE (symlinkat, "symlinkat is not portable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1245 "use gnulib module symlinkat for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1246 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1247 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1248
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1249
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1250 #if @GNULIB_TTYNAME_R@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1251 /* Store at most BUFLEN characters of the pathname of the terminal FD is
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1252 open on in BUF. Return 0 on success, otherwise an error number. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1253 # if @REPLACE_TTYNAME_R@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1254 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1255 # undef ttyname_r
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1256 # define ttyname_r rpl_ttyname_r
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1257 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1258 _GL_FUNCDECL_RPL (ttyname_r, int,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1259 (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1260 _GL_CXXALIAS_RPL (ttyname_r, int,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1261 (int fd, char *buf, size_t buflen));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1262 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1263 # if !@HAVE_DECL_TTYNAME_R@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1264 _GL_FUNCDECL_SYS (ttyname_r, int,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1265 (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1266 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1267 _GL_CXXALIAS_SYS (ttyname_r, int,
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1268 (int fd, char *buf, size_t buflen));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1269 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1270 _GL_CXXALIASWARN (ttyname_r);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1271 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1272 # undef ttyname_r
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1273 # if HAVE_RAW_DECL_TTYNAME_R
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1274 _GL_WARN_ON_USE (ttyname_r, "ttyname_r is not portable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1275 "use gnulib module ttyname_r for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1276 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1277 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1278
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1279
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1280 #if @GNULIB_UNLINK@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1281 # if @REPLACE_UNLINK@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1282 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1283 # undef unlink
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1284 # define unlink rpl_unlink
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1285 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1286 _GL_FUNCDECL_RPL (unlink, int, (char const *file) _GL_ARG_NONNULL ((1)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1287 _GL_CXXALIAS_RPL (unlink, int, (char const *file));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1288 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1289 _GL_CXXALIAS_SYS (unlink, int, (char const *file));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1290 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1291 _GL_CXXALIASWARN (unlink);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1292 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1293 # undef unlink
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1294 # if HAVE_RAW_DECL_UNLINK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1295 _GL_WARN_ON_USE (unlink, "unlink is not portable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1296 "use gnulib module unlink for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1297 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1298 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1299
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1300
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1301 #if @GNULIB_UNLINKAT@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1302 # if @REPLACE_UNLINKAT@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1303 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1304 # undef unlinkat
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1305 # define unlinkat rpl_unlinkat
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1306 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1307 _GL_FUNCDECL_RPL (unlinkat, int, (int fd, char const *file, int flag)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1308 _GL_ARG_NONNULL ((2)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1309 _GL_CXXALIAS_RPL (unlinkat, int, (int fd, char const *file, int flag));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1310 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1311 # if !@HAVE_UNLINKAT@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1312 _GL_FUNCDECL_SYS (unlinkat, int, (int fd, char const *file, int flag)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1313 _GL_ARG_NONNULL ((2)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1314 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1315 _GL_CXXALIAS_SYS (unlinkat, int, (int fd, char const *file, int flag));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1316 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1317 _GL_CXXALIASWARN (unlinkat);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1318 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1319 # undef unlinkat
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1320 # if HAVE_RAW_DECL_UNLINKAT
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1321 _GL_WARN_ON_USE (unlinkat, "unlinkat is not portable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1322 "use gnulib module openat for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1323 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1324 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1325
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1326
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1327 #if @GNULIB_USLEEP@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1328 /* Pause the execution of the current thread for N microseconds.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1329 Returns 0 on completion, or -1 on range error.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1330 See the POSIX:2001 specification
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1331 <http://www.opengroup.org/susv3xsh/sleep.html>. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1332 # if @REPLACE_USLEEP@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1333 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1334 # undef usleep
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1335 # define usleep rpl_usleep
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1336 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1337 _GL_FUNCDECL_RPL (usleep, int, (useconds_t n));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1338 _GL_CXXALIAS_RPL (usleep, int, (useconds_t n));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1339 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1340 # if !@HAVE_USLEEP@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1341 _GL_FUNCDECL_SYS (usleep, int, (useconds_t n));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1342 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1343 _GL_CXXALIAS_SYS (usleep, int, (useconds_t n));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1344 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1345 _GL_CXXALIASWARN (usleep);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1346 #elif defined GNULIB_POSIXCHECK
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1347 # undef usleep
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1348 # if HAVE_RAW_DECL_USLEEP
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1349 _GL_WARN_ON_USE (usleep, "usleep is unportable - "
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1350 "use gnulib module usleep for portability");
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1351 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1352 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1353
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1354
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1355 #if @GNULIB_WRITE@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1356 /* Write up to COUNT bytes starting at BUF to file descriptor FD.
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1357 See the POSIX:2001 specification
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1358 <http://www.opengroup.org/susv3xsh/write.html>. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1359 # if @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1360 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1361 # undef write
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1362 # define write rpl_write
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1363 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1364 _GL_FUNCDECL_RPL (write, ssize_t, (int fd, const void *buf, size_t count)
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1365 _GL_ARG_NONNULL ((2)));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1366 _GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1367 # else
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1368 /* Need to cast, because on mingw, the third parameter is
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1369 unsigned int count
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1370 and the return type is 'int'. */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1371 _GL_CXXALIAS_SYS_CAST (write, ssize_t, (int fd, const void *buf, size_t count));
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1372 # endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1373 _GL_CXXALIASWARN (write);
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1374 #endif
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1375
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1376
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1377 #endif /* _GL_UNISTD_H */
babd014aab81 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1378 #endif /* _GL_UNISTD_H */