annotate lib/unistd.in.h @ 283:2cb097e760a5 2.3

Added various generated files in prep for release
author lost
date Fri, 24 Apr 2009 22:18:16 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
283
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
1 /* Substitute for and wrapper around <unistd.h>.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
2 Copyright (C) 2003-2008 Free Software Foundation, Inc.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
3
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
4 This program is free software; you can redistribute it and/or modify
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
5 it under the terms of the GNU General Public License as published by
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
6 the Free Software Foundation; either version 3, or (at your option)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
7 any later version.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
8
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
12 GNU General Public License for more details.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
13
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
14 You should have received a copy of the GNU General Public License
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
15 along with this program; if not, write to the Free Software Foundation,
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
16 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
17
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
18 #ifndef _GL_UNISTD_H
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
19
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
20 #if __GNUC__ >= 3
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
21 @PRAGMA_SYSTEM_HEADER@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
22 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
23
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
24 /* The include_next requires a split double-inclusion guard. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
25 #if @HAVE_UNISTD_H@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
26 # @INCLUDE_NEXT@ @NEXT_UNISTD_H@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
27 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
28
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
29 #ifndef _GL_UNISTD_H
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
30 #define _GL_UNISTD_H
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
31
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
32 /* mingw doesn't define the SEEK_* macros in <unistd.h>. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
33 #if !(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
34 # include <stdio.h>
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
35 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
36
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
37 /* mingw fails to declare _exit in <unistd.h>. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
38 /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
39 #include <stdlib.h>
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
40
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
41 #if @GNULIB_WRITE@ && @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
42 /* Get ssize_t. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
43 # include <sys/types.h>
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
44 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
45
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
46 #if @GNULIB_GETHOSTNAME@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
47 /* Get all possible declarations of gethostname(). */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
48 # if @UNISTD_H_HAVE_WINSOCK2_H@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
49 # include <winsock2.h>
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
50 # if !defined _GL_SYS_SOCKET_H
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
51 # undef socket
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
52 # define socket socket_used_without_including_sys_socket_h
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
53 # undef connect
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
54 # define connect connect_used_without_including_sys_socket_h
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
55 # undef accept
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
56 # define accept accept_used_without_including_sys_socket_h
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
57 # undef bind
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
58 # define bind bind_used_without_including_sys_socket_h
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
59 # undef getpeername
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
60 # define getpeername getpeername_used_without_including_sys_socket_h
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
61 # undef getsockname
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
62 # define getsockname getsockname_used_without_including_sys_socket_h
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
63 # undef getsockopt
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
64 # define getsockopt getsockopt_used_without_including_sys_socket_h
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
65 # undef listen
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
66 # define listen listen_used_without_including_sys_socket_h
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
67 # undef recv
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
68 # define recv recv_used_without_including_sys_socket_h
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
69 # undef send
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
70 # define send send_used_without_including_sys_socket_h
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
71 # undef recvfrom
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
72 # define recvfrom recvfrom_used_without_including_sys_socket_h
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
73 # undef sendto
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
74 # define sendto sendto_used_without_including_sys_socket_h
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
75 # undef setsockopt
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
76 # define setsockopt setsockopt_used_without_including_sys_socket_h
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
77 # undef shutdown
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
78 # define shutdown shutdown_used_without_including_sys_socket_h
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
79 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
80 # if !defined _GL_SYS_SELECT_H
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
81 # undef select
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
82 # define select select_used_without_including_sys_select_h
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
83 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
84 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
85 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
86
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
87 /* The definition of GL_LINK_WARNING is copied here. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
88
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
89
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
90 /* Declare overridden functions. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
91
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
92 #ifdef __cplusplus
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
93 extern "C" {
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
94 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
95
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
96
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
97 #if @GNULIB_CHOWN@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
98 # if @REPLACE_CHOWN@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
99 # ifndef REPLACE_CHOWN
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
100 # define REPLACE_CHOWN 1
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
101 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
102 # if REPLACE_CHOWN
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
103 /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
104 to GID (if GID is not -1). Follow symbolic links.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
105 Return 0 if successful, otherwise -1 and errno set.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
106 See the POSIX:2001 specification
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
107 <http://www.opengroup.org/susv3xsh/chown.html>. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
108 # define chown rpl_chown
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
109 extern int chown (const char *file, uid_t uid, gid_t gid);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
110 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
111 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
112 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
113 # undef chown
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
114 # define chown(f,u,g) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
115 (GL_LINK_WARNING ("chown fails to follow symlinks on some systems and " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
116 "doesn't treat a uid or gid of -1 on some systems - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
117 "use gnulib module chown for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
118 chown (f, u, g))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
119 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
120
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
121
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
122 #if @GNULIB_CLOSE@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
123 # if @UNISTD_H_HAVE_WINSOCK2_H@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
124 /* Need a gnulib internal function. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
125 # define HAVE__GL_CLOSE_FD_MAYBE_SOCKET 1
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
126 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
127 # if @REPLACE_CLOSE@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
128 /* Automatically included by modules that need a replacement for close. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
129 # undef close
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
130 # define close rpl_close
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
131 extern int close (int);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
132 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
133 #elif @UNISTD_H_HAVE_WINSOCK2_H@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
134 # undef close
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
135 # define close close_used_without_requesting_gnulib_module_close
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
136 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
137 # undef close
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
138 # define close(f) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
139 (GL_LINK_WARNING ("close does not portably work on sockets - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
140 "use gnulib module close for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
141 close (f))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
142 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
143
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
144
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
145 #if @GNULIB_DUP2@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
146 # if !@HAVE_DUP2@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
147 /* Copy the file descriptor OLDFD into file descriptor NEWFD. Do nothing if
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
148 NEWFD = OLDFD, otherwise close NEWFD first if it is open.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
149 Return 0 if successful, otherwise -1 and errno set.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
150 See the POSIX:2001 specification
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
151 <http://www.opengroup.org/susv3xsh/dup2.html>. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
152 extern int dup2 (int oldfd, int newfd);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
153 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
154 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
155 # undef dup2
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
156 # define dup2(o,n) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
157 (GL_LINK_WARNING ("dup2 is unportable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
158 "use gnulib module dup2 for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
159 dup2 (o, n))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
160 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
161
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
162
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
163 #if @GNULIB_ENVIRON@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
164 # if !@HAVE_DECL_ENVIRON@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
165 /* Set of environment variables and values. An array of strings of the form
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
166 "VARIABLE=VALUE", terminated with a NULL. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
167 # if defined __APPLE__ && defined __MACH__
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
168 # include <crt_externs.h>
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
169 # define environ (*_NSGetEnviron ())
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
170 # else
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
171 extern char **environ;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
172 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
173 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
174 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
175 # undef environ
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
176 # define environ \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
177 (GL_LINK_WARNING ("environ is unportable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
178 "use gnulib module environ for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
179 environ)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
180 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
181
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
182
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
183 #if @GNULIB_EUIDACCESS@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
184 # if !@HAVE_EUIDACCESS@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
185 /* Like access(), except that is uses the effective user id and group id of
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
186 the current process. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
187 extern int euidaccess (const char *filename, int mode);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
188 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
189 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
190 # undef euidaccess
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
191 # define euidaccess(f,m) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
192 (GL_LINK_WARNING ("euidaccess is unportable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
193 "use gnulib module euidaccess for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
194 euidaccess (f, m))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
195 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
196
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
197
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
198 #if @GNULIB_FCHDIR@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
199 # if @REPLACE_FCHDIR@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
200
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
201 /* Change the process' current working directory to the directory on which
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
202 the given file descriptor is open.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
203 Return 0 if successful, otherwise -1 and errno set.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
204 See the POSIX:2001 specification
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
205 <http://www.opengroup.org/susv3xsh/fchdir.html>. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
206 extern int fchdir (int /*fd*/);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
207
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
208 # define dup rpl_dup
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
209 extern int dup (int);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
210 # define dup2 rpl_dup2
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
211 extern int dup2 (int, int);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
212
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
213 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
214 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
215 # undef fchdir
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
216 # define fchdir(f) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
217 (GL_LINK_WARNING ("fchdir is unportable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
218 "use gnulib module fchdir for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
219 fchdir (f))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
220 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
221
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
222
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
223 #if @GNULIB_FSYNC@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
224 /* Synchronize changes to a file.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
225 Return 0 if successful, otherwise -1 and errno set.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
226 See POSIX:2001 specification
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
227 <http://www.opengroup.org/susv3xsh/fsync.html>. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
228 # if !@HAVE_FSYNC@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
229 extern int fsync (int fd);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
230 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
231 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
232 # undef fsync
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
233 # define fsync(fd) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
234 (GL_LINK_WARNING ("fsync is unportable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
235 "use gnulib module fsync for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
236 fsync (fd))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
237 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
238
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
239
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
240 #if @GNULIB_FTRUNCATE@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
241 # if !@HAVE_FTRUNCATE@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
242 /* Change the size of the file to which FD is opened to become equal to LENGTH.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
243 Return 0 if successful, otherwise -1 and errno set.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
244 See the POSIX:2001 specification
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
245 <http://www.opengroup.org/susv3xsh/ftruncate.html>. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
246 extern int ftruncate (int fd, off_t length);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
247 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
248 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
249 # undef ftruncate
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
250 # define ftruncate(f,l) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
251 (GL_LINK_WARNING ("ftruncate is unportable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
252 "use gnulib module ftruncate for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
253 ftruncate (f, l))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
254 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
255
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
256
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
257 #if @GNULIB_GETCWD@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
258 /* Include the headers that might declare getcwd so that they will not
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
259 cause confusion if included after this file. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
260 # include <stdlib.h>
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
261 # if @REPLACE_GETCWD@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
262 /* Get the name of the current working directory, and put it in SIZE bytes
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
263 of BUF.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
264 Return BUF if successful, or NULL if the directory couldn't be determined
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
265 or SIZE was too small.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
266 See the POSIX:2001 specification
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
267 <http://www.opengroup.org/susv3xsh/getcwd.html>.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
268 Additionally, the gnulib module 'getcwd' guarantees the following GNU
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
269 extension: If BUF is NULL, an array is allocated with 'malloc'; the array
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
270 is SIZE bytes long, unless SIZE == 0, in which case it is as big as
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
271 necessary. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
272 # define getcwd rpl_getcwd
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
273 extern char * getcwd (char *buf, size_t size);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
274 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
275 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
276 # undef getcwd
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
277 # define getcwd(b,s) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
278 (GL_LINK_WARNING ("getcwd is unportable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
279 "use gnulib module getcwd for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
280 getcwd (b, s))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
281 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
282
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
283
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
284 #if @GNULIB_GETDOMAINNAME@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
285 /* Return the NIS domain name of the machine.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
286 WARNING! The NIS domain name is unrelated to the fully qualified host name
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
287 of the machine. It is also unrelated to email addresses.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
288 WARNING! The NIS domain name is usually the empty string or "(none)" when
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
289 not using NIS.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
290
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
291 Put up to LEN bytes of the NIS domain name into NAME.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
292 Null terminate it if the name is shorter than LEN.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
293 If the NIS domain name is longer than LEN, set errno = EINVAL and return -1.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
294 Return 0 if successful, otherwise set errno and return -1. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
295 # if !@HAVE_GETDOMAINNAME@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
296 extern int getdomainname(char *name, size_t len);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
297 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
298 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
299 # undef getdomainname
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
300 # define getdomainname(n,l) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
301 (GL_LINK_WARNING ("getdomainname is unportable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
302 "use gnulib module getdomainname for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
303 getdomainname (n, l))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
304 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
305
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
306
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
307 #if @GNULIB_GETDTABLESIZE@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
308 # if !@HAVE_GETDTABLESIZE@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
309 /* Return the maximum number of file descriptors in the current process. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
310 extern int getdtablesize (void);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
311 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
312 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
313 # undef getdtablesize
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
314 # define getdtablesize() \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
315 (GL_LINK_WARNING ("getdtablesize is unportable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
316 "use gnulib module getdtablesize for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
317 getdtablesize ())
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
318 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
319
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
320
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
321 #if @GNULIB_GETHOSTNAME@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
322 /* Return the standard host name of the machine.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
323 WARNING! The host name may or may not be fully qualified.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
324
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
325 Put up to LEN bytes of the host name into NAME.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
326 Null terminate it if the name is shorter than LEN.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
327 If the host name is longer than LEN, set errno = EINVAL and return -1.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
328 Return 0 if successful, otherwise set errno and return -1. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
329 # if @UNISTD_H_HAVE_WINSOCK2_H@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
330 # undef gethostname
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
331 # define gethostname rpl_gethostname
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
332 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
333 # if @UNISTD_H_HAVE_WINSOCK2_H@ || !@HAVE_GETHOSTNAME@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
334 extern int gethostname(char *name, size_t len);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
335 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
336 #elif @UNISTD_H_HAVE_WINSOCK2_H@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
337 # undef gethostname
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
338 # define gethostname gethostname_used_without_requesting_gnulib_module_gethostname
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
339 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
340 # undef gethostname
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
341 # define gethostname(n,l) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
342 (GL_LINK_WARNING ("gethostname is unportable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
343 "use gnulib module gethostname for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
344 gethostname (n, l))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
345 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
346
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
347
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
348 #if @GNULIB_GETLOGIN_R@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
349 /* Copies the user's login name to NAME.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
350 The array pointed to by NAME has room for SIZE bytes.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
351
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
352 Returns 0 if successful. Upon error, an error number is returned, or -1 in
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
353 the case that the login name cannot be found but no specific error is
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
354 provided (this case is hopefully rare but is left open by the POSIX spec).
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
355
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
356 See <http://www.opengroup.org/susv3xsh/getlogin.html>.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
357 */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
358 # if !@HAVE_DECL_GETLOGIN_R@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
359 # include <stddef.h>
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
360 extern int getlogin_r (char *name, size_t size);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
361 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
362 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
363 # undef getlogin_r
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
364 # define getlogin_r(n,s) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
365 (GL_LINK_WARNING ("getlogin_r is unportable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
366 "use gnulib module getlogin_r for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
367 getlogin_r (n, s))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
368 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
369
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
370
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
371 #if @GNULIB_GETPAGESIZE@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
372 # if @REPLACE_GETPAGESIZE@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
373 # define getpagesize rpl_getpagesize
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
374 extern int getpagesize (void);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
375 # elif !@HAVE_GETPAGESIZE@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
376 /* This is for POSIX systems. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
377 # if !defined getpagesize && defined _SC_PAGESIZE
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
378 # if ! (defined __VMS && __VMS_VER < 70000000)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
379 # define getpagesize() sysconf (_SC_PAGESIZE)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
380 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
381 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
382 /* This is for older VMS. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
383 # if !defined getpagesize && defined __VMS
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
384 # ifdef __ALPHA
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
385 # define getpagesize() 8192
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
386 # else
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
387 # define getpagesize() 512
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
388 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
389 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
390 /* This is for BeOS. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
391 # if !defined getpagesize && @HAVE_OS_H@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
392 # include <OS.h>
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
393 # if defined B_PAGE_SIZE
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
394 # define getpagesize() B_PAGE_SIZE
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
395 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
396 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
397 /* This is for AmigaOS4.0. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
398 # if !defined getpagesize && defined __amigaos4__
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
399 # define getpagesize() 2048
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
400 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
401 /* This is for older Unix systems. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
402 # if !defined getpagesize && @HAVE_SYS_PARAM_H@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
403 # include <sys/param.h>
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
404 # ifdef EXEC_PAGESIZE
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
405 # define getpagesize() EXEC_PAGESIZE
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
406 # else
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
407 # ifdef NBPG
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
408 # ifndef CLSIZE
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
409 # define CLSIZE 1
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
410 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
411 # define getpagesize() (NBPG * CLSIZE)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
412 # else
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
413 # ifdef NBPC
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
414 # define getpagesize() NBPC
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
415 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
416 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
417 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
418 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
419 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
420 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
421 # undef getpagesize
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
422 # define getpagesize() \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
423 (GL_LINK_WARNING ("getpagesize is unportable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
424 "use gnulib module getpagesize for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
425 getpagesize ())
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
426 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
427
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
428
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
429 #if @GNULIB_GETUSERSHELL@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
430 # if !@HAVE_GETUSERSHELL@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
431 /* Return the next valid login shell on the system, or NULL when the end of
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
432 the list has been reached. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
433 extern char *getusershell (void);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
434 /* Rewind to pointer that is advanced at each getusershell() call. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
435 extern void setusershell (void);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
436 /* Free the pointer that is advanced at each getusershell() call and
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
437 associated resources. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
438 extern void endusershell (void);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
439 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
440 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
441 # undef getusershell
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
442 # define getusershell() \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
443 (GL_LINK_WARNING ("getusershell is unportable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
444 "use gnulib module getusershell for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
445 getusershell ())
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
446 # undef setusershell
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
447 # define setusershell() \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
448 (GL_LINK_WARNING ("setusershell is unportable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
449 "use gnulib module getusershell for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
450 setusershell ())
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
451 # undef endusershell
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
452 # define endusershell() \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
453 (GL_LINK_WARNING ("endusershell is unportable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
454 "use gnulib module getusershell for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
455 endusershell ())
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
456 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
457
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
458
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
459 #if @GNULIB_LCHOWN@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
460 # if @REPLACE_LCHOWN@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
461 /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
462 to GID (if GID is not -1). Do not follow symbolic links.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
463 Return 0 if successful, otherwise -1 and errno set.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
464 See the POSIX:2001 specification
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
465 <http://www.opengroup.org/susv3xsh/lchown.html>. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
466 # define lchown rpl_lchown
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
467 extern int lchown (char const *file, uid_t owner, gid_t group);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
468 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
469 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
470 # undef lchown
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
471 # define lchown(f,u,g) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
472 (GL_LINK_WARNING ("lchown is unportable to pre-POSIX.1-2001 " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
473 "systems - use gnulib module lchown for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
474 lchown (f, u, g))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
475 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
476
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
477
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
478 #if @GNULIB_LSEEK@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
479 # if @REPLACE_LSEEK@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
480 /* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
481 Return the new offset if successful, otherwise -1 and errno set.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
482 See the POSIX:2001 specification
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
483 <http://www.opengroup.org/susv3xsh/lseek.html>. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
484 # define lseek rpl_lseek
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
485 extern off_t lseek (int fd, off_t offset, int whence);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
486 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
487 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
488 # undef lseek
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
489 # define lseek(f,o,w) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
490 (GL_LINK_WARNING ("lseek does not fail with ESPIPE on pipes on some " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
491 "systems - use gnulib module lseek for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
492 lseek (f, o, w))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
493 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
494
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
495
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
496 #if @GNULIB_READLINK@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
497 /* Read the contents of the symbolic link FILE and place the first BUFSIZE
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
498 bytes of it into BUF. Return the number of bytes placed into BUF if
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
499 successful, otherwise -1 and errno set.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
500 See the POSIX:2001 specification
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
501 <http://www.opengroup.org/susv3xsh/readlink.html>. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
502 # if !@HAVE_READLINK@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
503 # include <stddef.h>
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
504 extern int readlink (const char *file, char *buf, size_t bufsize);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
505 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
506 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
507 # undef readlink
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
508 # define readlink(f,b,s) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
509 (GL_LINK_WARNING ("readlink is unportable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
510 "use gnulib module readlink for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
511 readlink (f, b, s))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
512 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
513
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
514
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
515 #if @GNULIB_SLEEP@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
516 /* Pause the execution of the current thread for N seconds.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
517 Returns the number of seconds left to sleep.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
518 See the POSIX:2001 specification
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
519 <http://www.opengroup.org/susv3xsh/sleep.html>. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
520 # if !@HAVE_SLEEP@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
521 extern unsigned int sleep (unsigned int n);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
522 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
523 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
524 # undef sleep
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
525 # define sleep(n) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
526 (GL_LINK_WARNING ("sleep is unportable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
527 "use gnulib module sleep for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
528 sleep (n))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
529 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
530
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
531
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
532 #if @GNULIB_WRITE@ && @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
533 /* Write up to COUNT bytes starting at BUF to file descriptor FD.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
534 See the POSIX:2001 specification
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
535 <http://www.opengroup.org/susv3xsh/write.html>. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
536 # undef write
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
537 # define write rpl_write
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
538 extern ssize_t write (int fd, const void *buf, size_t count);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
539 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
540
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
541
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
542 #ifdef FCHDIR_REPLACEMENT
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
543 /* gnulib internal function. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
544 extern void _gl_unregister_fd (int fd);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
545 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
546
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
547
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
548 #ifdef __cplusplus
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
549 }
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
550 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
551
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
552
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
553 #endif /* _GL_UNISTD_H */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
554 #endif /* _GL_UNISTD_H */