annotate lib/unistd.in.h @ 448:5cccf90bf838 3.0 tip

Fixed bug with complex external references generating invalid relocations in the object file
author lost@l-w.ca
date Fri, 05 Nov 2010 22:27:00 -0600
parents b8bf63962a99
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
434
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
1 /* Substitute for and wrapper around <unistd.h>.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
2 Copyright (C) 2003-2010 Free Software Foundation, Inc.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
3
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
4 This program is free software; you can redistribute it and/or modify
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
5 it under the terms of the GNU General Public License as published by
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
6 the Free Software Foundation; either version 3, or (at your option)
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
7 any later version.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
8
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
12 GNU General Public License for more details.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
13
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
14 You should have received a copy of the GNU General Public License
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
15 along with this program; if not, write to the Free Software Foundation,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
16 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
17
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
18 #ifndef _GL_UNISTD_H
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
19
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
20 #if __GNUC__ >= 3
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
21 @PRAGMA_SYSTEM_HEADER@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
22 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
23
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
24 /* The include_next requires a split double-inclusion guard. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
25 #if @HAVE_UNISTD_H@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
26 # @INCLUDE_NEXT@ @NEXT_UNISTD_H@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
27 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
28
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
29 #ifndef _GL_UNISTD_H
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
30 #define _GL_UNISTD_H
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
31
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
32 /* NetBSD 5.0 mis-defines NULL. Also get size_t. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
33 #include <stddef.h>
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
34
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
35 /* mingw doesn't define the SEEK_* or *_FILENO macros in <unistd.h>. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
36 /* Cygwin 1.7.1 declares symlinkat in <stdio.h>, not in <unistd.h>. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
37 /* But avoid namespace pollution on glibc systems. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
38 #if (!(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
39 || (@GNULIB_SYMLINKAT@ || defined GNULIB_POSIXCHECK)) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
40 && ! defined __GLIBC__
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
41 # include <stdio.h>
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
42 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
43
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
44 /* Cygwin 1.7.1 declares unlinkat in <fcntl.h>, not in <unistd.h>. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
45 /* But avoid namespace pollution on glibc systems. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
46 #if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
47 # include <fcntl.h>
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
48 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
49
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
50 /* mingw fails to declare _exit in <unistd.h>. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
51 /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
52 /* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
53 /* But avoid namespace pollution on glibc systems. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
54 #ifndef __GLIBC__
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
55 # include <stdlib.h>
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
56 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
57
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
58 /* mingw declares getcwd in <io.h>, not in <unistd.h>. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
59 #if ((@GNULIB_GETCWD@ || defined GNULIB_POSIXCHECK) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
60 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
61 # include <io.h>
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
62 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
63
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
64 #if (@GNULIB_WRITE@ || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
65 || @GNULIB_PREAD@ || defined GNULIB_POSIXCHECK)
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
66 /* Get ssize_t. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
67 # include <sys/types.h>
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
68 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
69
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
70 /* Get getopt(), optarg, optind, opterr, optopt.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
71 But avoid namespace pollution on glibc systems. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
72 #if @GNULIB_UNISTD_H_GETOPT@ && !defined __GLIBC__ && !defined _GL_SYSTEM_GETOPT
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
73 # include <getopt.h>
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
74 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
75
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
76 #if @GNULIB_GETHOSTNAME@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
77 /* Get all possible declarations of gethostname(). */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
78 # if @UNISTD_H_HAVE_WINSOCK2_H@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
79 # include <winsock2.h>
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
80 # if !defined _GL_SYS_SOCKET_H
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
81 # undef socket
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
82 # define socket socket_used_without_including_sys_socket_h
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
83 # undef connect
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
84 # define connect connect_used_without_including_sys_socket_h
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
85 # undef accept
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
86 # define accept accept_used_without_including_sys_socket_h
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
87 # undef bind
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
88 # define bind bind_used_without_including_sys_socket_h
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
89 # undef getpeername
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
90 # define getpeername getpeername_used_without_including_sys_socket_h
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
91 # undef getsockname
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
92 # define getsockname getsockname_used_without_including_sys_socket_h
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
93 # undef getsockopt
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
94 # define getsockopt getsockopt_used_without_including_sys_socket_h
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
95 # undef listen
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
96 # define listen listen_used_without_including_sys_socket_h
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
97 # undef recv
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
98 # define recv recv_used_without_including_sys_socket_h
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
99 # undef send
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
100 # define send send_used_without_including_sys_socket_h
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
101 # undef recvfrom
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
102 # define recvfrom recvfrom_used_without_including_sys_socket_h
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
103 # undef sendto
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
104 # define sendto sendto_used_without_including_sys_socket_h
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
105 # undef setsockopt
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
106 # define setsockopt setsockopt_used_without_including_sys_socket_h
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
107 # undef shutdown
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
108 # define shutdown shutdown_used_without_including_sys_socket_h
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
109 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
110 # if !defined _GL_SYS_SELECT_H
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
111 # undef select
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
112 # define select select_used_without_including_sys_select_h
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
113 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
114 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
115 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
116
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
117 /* The definition of GL_LINK_WARNING is copied here. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
118
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
119 /* The definition of _GL_ARG_NONNULL is copied here. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
120
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
121
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
122 /* OS/2 EMX lacks these macros. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
123 #ifndef STDIN_FILENO
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
124 # define STDIN_FILENO 0
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
125 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
126 #ifndef STDOUT_FILENO
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
127 # define STDOUT_FILENO 1
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
128 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
129 #ifndef STDERR_FILENO
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
130 # define STDERR_FILENO 2
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
131 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
132
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
133 /* Ensure *_OK macros exist. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
134 #ifndef F_OK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
135 # define F_OK 0
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
136 # define X_OK 1
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
137 # define W_OK 2
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
138 # define R_OK 4
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
139 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
140
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
141
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
142 /* Declare overridden functions. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
143
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
144 #ifdef __cplusplus
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
145 extern "C" {
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
146 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
147
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
148
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
149 #if @GNULIB_CHOWN@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
150 # if @REPLACE_CHOWN@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
151 # undef chown
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
152 # define chown rpl_chown
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
153 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
154 # if !@HAVE_CHOWN@ || @REPLACE_CHOWN@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
155 /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
156 to GID (if GID is not -1). Follow symbolic links.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
157 Return 0 if successful, otherwise -1 and errno set.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
158 See the POSIX:2001 specification
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
159 <http://www.opengroup.org/susv3xsh/chown.html>. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
160 extern int chown (const char *file, uid_t uid, gid_t gid)
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
161 _GL_ARG_NONNULL ((1));
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
162 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
163 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
164 # undef chown
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
165 # define chown(f,u,g) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
166 (GL_LINK_WARNING ("chown fails to follow symlinks on some systems and " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
167 "doesn't treat a uid or gid of -1 on some systems - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
168 "use gnulib module chown for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
169 chown (f, u, g))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
170 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
171
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
172
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
173 #if @GNULIB_CLOSE@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
174 # if @REPLACE_CLOSE@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
175 /* Automatically included by modules that need a replacement for close. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
176 # undef close
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
177 # define close rpl_close
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
178 extern int close (int);
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
179 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
180 #elif @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
181 # undef close
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
182 # define close close_used_without_requesting_gnulib_module_close
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
183 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
184 # undef close
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
185 # define close(f) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
186 (GL_LINK_WARNING ("close does not portably work on sockets - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
187 "use gnulib module close for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
188 close (f))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
189 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
190
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
191
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
192 #if @REPLACE_DUP@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
193 # define dup rpl_dup
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
194 extern int dup (int);
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
195 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
196
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
197
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
198 #if @GNULIB_DUP2@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
199 # if @REPLACE_DUP2@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
200 # define dup2 rpl_dup2
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
201 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
202 # if !@HAVE_DUP2@ || @REPLACE_DUP2@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
203 /* Copy the file descriptor OLDFD into file descriptor NEWFD. Do nothing if
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
204 NEWFD = OLDFD, otherwise close NEWFD first if it is open.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
205 Return newfd if successful, otherwise -1 and errno set.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
206 See the POSIX:2001 specification
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
207 <http://www.opengroup.org/susv3xsh/dup2.html>. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
208 extern int dup2 (int oldfd, int newfd);
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
209 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
210 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
211 # undef dup2
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
212 # define dup2(o,n) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
213 (GL_LINK_WARNING ("dup2 is unportable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
214 "use gnulib module dup2 for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
215 dup2 (o, n))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
216 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
217
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
218
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
219 #if @GNULIB_DUP3@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
220 /* Copy the file descriptor OLDFD into file descriptor NEWFD, with the
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
221 specified flags.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
222 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
223 and O_TEXT, O_BINARY (defined in "binary-io.h").
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
224 Close NEWFD first if it is open.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
225 Return newfd if successful, otherwise -1 and errno set.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
226 See the Linux man page at
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
227 <http://www.kernel.org/doc/man-pages/online/pages/man2/dup3.2.html>. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
228 # if @HAVE_DUP3@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
229 # define dup3 rpl_dup3
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
230 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
231 extern int dup3 (int oldfd, int newfd, int flags);
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
232 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
233 # undef dup3
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
234 # define dup3(o,n,f) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
235 (GL_LINK_WARNING ("dup3 is unportable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
236 "use gnulib module dup3 for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
237 dup3 (o, n, f))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
238 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
239
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
240
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
241 #if @GNULIB_ENVIRON@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
242 # if !@HAVE_DECL_ENVIRON@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
243 /* Set of environment variables and values. An array of strings of the form
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
244 "VARIABLE=VALUE", terminated with a NULL. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
245 # if defined __APPLE__ && defined __MACH__
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
246 # include <crt_externs.h>
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
247 # define environ (*_NSGetEnviron ())
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
248 # else
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
249 extern char **environ;
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
250 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
251 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
252 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
253 # undef environ
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
254 # define environ \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
255 (GL_LINK_WARNING ("environ is unportable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
256 "use gnulib module environ for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
257 environ)
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
258 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
259
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
260
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
261 #if @GNULIB_EUIDACCESS@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
262 # if !@HAVE_EUIDACCESS@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
263 /* Like access(), except that it uses the effective user id and group id of
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
264 the current process. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
265 extern int euidaccess (const char *filename, int mode) _GL_ARG_NONNULL ((1));
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
266 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
267 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
268 # undef euidaccess
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
269 # define euidaccess(f,m) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
270 (GL_LINK_WARNING ("euidaccess is unportable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
271 "use gnulib module euidaccess for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
272 euidaccess (f, m))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
273 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
274
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
275
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
276 #if @GNULIB_FACCESSAT@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
277 # if !@HAVE_FACCESSAT@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
278 extern int faccessat (int fd, char const *file, int mode, int flag)
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
279 _GL_ARG_NONNULL ((2));
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
280 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
281 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
282 # undef faccessat
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
283 # define faccessat(d,n,m,f) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
284 (GL_LINK_WARNING ("faccessat is not portable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
285 "use gnulib module faccessat for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
286 faccessat (d, n, m, f))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
287 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
288
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
289
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
290 #if @GNULIB_FCHDIR@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
291 # if @REPLACE_FCHDIR@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
292 /* Change the process' current working directory to the directory on which
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
293 the given file descriptor is open.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
294 Return 0 if successful, otherwise -1 and errno set.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
295 See the POSIX:2001 specification
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
296 <http://www.opengroup.org/susv3xsh/fchdir.html>. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
297 extern int fchdir (int /*fd*/);
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
298
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
299 /* Gnulib internal hooks needed to maintain the fchdir metadata. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
300 extern int _gl_register_fd (int fd, const char *filename)
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
301 _GL_ARG_NONNULL ((2));
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
302 extern void _gl_unregister_fd (int fd);
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
303 extern int _gl_register_dup (int oldfd, int newfd);
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
304 extern const char *_gl_directory_name (int fd);
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
305
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
306 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
307 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
308 # undef fchdir
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
309 # define fchdir(f) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
310 (GL_LINK_WARNING ("fchdir is unportable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
311 "use gnulib module fchdir for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
312 fchdir (f))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
313 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
314
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
315
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
316 #if @GNULIB_FCHOWNAT@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
317 # if @REPLACE_FCHOWNAT@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
318 # undef fchownat
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
319 # define fchownat rpl_fchownat
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
320 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
321 # if !@HAVE_FCHOWNAT@ || @REPLACE_FCHOWNAT@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
322 extern int fchownat (int fd, char const *file, uid_t owner, gid_t group, int flag)
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
323 _GL_ARG_NONNULL ((2));
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
324 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
325 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
326 # undef fchownat
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
327 # define fchownat(d,n,o,g,f) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
328 (GL_LINK_WARNING ("fchownat is not portable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
329 "use gnulib module openat for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
330 fchownat (d, n, o, g, f))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
331 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
332
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
333
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
334 #if @GNULIB_FSYNC@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
335 /* Synchronize changes to a file.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
336 Return 0 if successful, otherwise -1 and errno set.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
337 See POSIX:2001 specification
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
338 <http://www.opengroup.org/susv3xsh/fsync.html>. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
339 # if !@HAVE_FSYNC@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
340 extern int fsync (int fd);
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
341 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
342 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
343 # undef fsync
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
344 # define fsync(fd) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
345 (GL_LINK_WARNING ("fsync is unportable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
346 "use gnulib module fsync for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
347 fsync (fd))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
348 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
349
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
350
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
351 #if @GNULIB_FTRUNCATE@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
352 # if !@HAVE_FTRUNCATE@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
353 /* Change the size of the file to which FD is opened to become equal to LENGTH.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
354 Return 0 if successful, otherwise -1 and errno set.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
355 See the POSIX:2001 specification
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
356 <http://www.opengroup.org/susv3xsh/ftruncate.html>. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
357 extern int ftruncate (int fd, off_t length);
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
358 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
359 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
360 # undef ftruncate
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
361 # define ftruncate(f,l) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
362 (GL_LINK_WARNING ("ftruncate is unportable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
363 "use gnulib module ftruncate for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
364 ftruncate (f, l))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
365 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
366
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
367
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
368 #if @GNULIB_GETCWD@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
369 # if @REPLACE_GETCWD@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
370 /* Get the name of the current working directory, and put it in SIZE bytes
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
371 of BUF.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
372 Return BUF if successful, or NULL if the directory couldn't be determined
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
373 or SIZE was too small.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
374 See the POSIX:2001 specification
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
375 <http://www.opengroup.org/susv3xsh/getcwd.html>.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
376 Additionally, the gnulib module 'getcwd' guarantees the following GNU
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
377 extension: If BUF is NULL, an array is allocated with 'malloc'; the array
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
378 is SIZE bytes long, unless SIZE == 0, in which case it is as big as
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
379 necessary. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
380 # define getcwd rpl_getcwd
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
381 extern char * getcwd (char *buf, size_t size);
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
382 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
383 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
384 # undef getcwd
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
385 # define getcwd(b,s) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
386 (GL_LINK_WARNING ("getcwd is unportable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
387 "use gnulib module getcwd for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
388 getcwd (b, s))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
389 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
390
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
391
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
392 #if @GNULIB_GETDOMAINNAME@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
393 /* Return the NIS domain name of the machine.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
394 WARNING! The NIS domain name is unrelated to the fully qualified host name
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
395 of the machine. It is also unrelated to email addresses.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
396 WARNING! The NIS domain name is usually the empty string or "(none)" when
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
397 not using NIS.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
398
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
399 Put up to LEN bytes of the NIS domain name into NAME.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
400 Null terminate it if the name is shorter than LEN.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
401 If the NIS domain name is longer than LEN, set errno = EINVAL and return -1.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
402 Return 0 if successful, otherwise set errno and return -1. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
403 # if !@HAVE_GETDOMAINNAME@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
404 extern int getdomainname(char *name, size_t len) _GL_ARG_NONNULL ((1));
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
405 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
406 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
407 # undef getdomainname
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
408 # define getdomainname(n,l) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
409 (GL_LINK_WARNING ("getdomainname is unportable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
410 "use gnulib module getdomainname for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
411 getdomainname (n, l))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
412 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
413
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
414
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
415 #if @GNULIB_GETDTABLESIZE@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
416 # if !@HAVE_GETDTABLESIZE@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
417 /* Return the maximum number of file descriptors in the current process.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
418 In POSIX, this is same as sysconf (_SC_OPEN_MAX). */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
419 extern int getdtablesize (void);
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
420 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
421 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
422 # undef getdtablesize
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
423 # define getdtablesize() \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
424 (GL_LINK_WARNING ("getdtablesize is unportable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
425 "use gnulib module getdtablesize for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
426 getdtablesize ())
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
427 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
428
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
429
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
430 #if @GNULIB_GETGROUPS@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
431 # if @REPLACE_GETGROUPS@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
432 # undef getgroups
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
433 # define getgroups rpl_getgroups
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
434 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
435 # if !@HAVE_GETGROUPS@ || @REPLACE_GETGROUPS@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
436 /* Return the supplemental groups that the current process belongs to.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
437 It is unspecified whether the effective group id is in the list.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
438 If N is 0, return the group count; otherwise, N describes how many
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
439 entries are available in GROUPS. Return -1 and set errno if N is
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
440 not 0 and not large enough. Fails with ENOSYS on some systems. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
441 int getgroups (int n, gid_t *groups);
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
442 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
443 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
444 # undef getgroups
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
445 # define getgroups(n,g) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
446 (GL_LINK_WARNING ("getgroups is unportable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
447 "use gnulib module getgroups for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
448 getgroups (n, g))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
449 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
450
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
451
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
452 #if @GNULIB_GETHOSTNAME@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
453 /* Return the standard host name of the machine.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
454 WARNING! The host name may or may not be fully qualified.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
455
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
456 Put up to LEN bytes of the host name into NAME.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
457 Null terminate it if the name is shorter than LEN.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
458 If the host name is longer than LEN, set errno = EINVAL and return -1.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
459 Return 0 if successful, otherwise set errno and return -1. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
460 # if @UNISTD_H_HAVE_WINSOCK2_H@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
461 # undef gethostname
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
462 # define gethostname rpl_gethostname
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
463 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
464 # if @UNISTD_H_HAVE_WINSOCK2_H@ || !@HAVE_GETHOSTNAME@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
465 extern int gethostname(char *name, size_t len) _GL_ARG_NONNULL ((1));
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
466 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
467 #elif @UNISTD_H_HAVE_WINSOCK2_H@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
468 # undef gethostname
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
469 # define gethostname gethostname_used_without_requesting_gnulib_module_gethostname
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
470 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
471 # undef gethostname
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
472 # define gethostname(n,l) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
473 (GL_LINK_WARNING ("gethostname is unportable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
474 "use gnulib module gethostname for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
475 gethostname (n, l))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
476 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
477
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
478
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
479 #if @GNULIB_GETLOGIN_R@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
480 /* Copies the user's login name to NAME.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
481 The array pointed to by NAME has room for SIZE bytes.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
482
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
483 Returns 0 if successful. Upon error, an error number is returned, or -1 in
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
484 the case that the login name cannot be found but no specific error is
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
485 provided (this case is hopefully rare but is left open by the POSIX spec).
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
486
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
487 See <http://www.opengroup.org/susv3xsh/getlogin.html>.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
488
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
489 Most programs don't need to use this function, because the information is
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
490 available through environment variables:
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
491 ${LOGNAME-$USER} on Unix platforms,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
492 $USERNAME on native Windows platforms.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
493 */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
494 # if !@HAVE_DECL_GETLOGIN_R@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
495 extern int getlogin_r (char *name, size_t size) _GL_ARG_NONNULL ((1));
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
496 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
497 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
498 # undef getlogin_r
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
499 # define getlogin_r(n,s) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
500 (GL_LINK_WARNING ("getlogin_r is unportable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
501 "use gnulib module getlogin_r for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
502 getlogin_r (n, s))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
503 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
504
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
505
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
506 #if @GNULIB_GETPAGESIZE@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
507 # if @REPLACE_GETPAGESIZE@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
508 # define getpagesize rpl_getpagesize
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
509 extern int getpagesize (void);
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
510 # elif !@HAVE_GETPAGESIZE@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
511 /* This is for POSIX systems. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
512 # if !defined getpagesize && defined _SC_PAGESIZE
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
513 # if ! (defined __VMS && __VMS_VER < 70000000)
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
514 # define getpagesize() sysconf (_SC_PAGESIZE)
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
515 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
516 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
517 /* This is for older VMS. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
518 # if !defined getpagesize && defined __VMS
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
519 # ifdef __ALPHA
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
520 # define getpagesize() 8192
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
521 # else
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
522 # define getpagesize() 512
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
523 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
524 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
525 /* This is for BeOS. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
526 # if !defined getpagesize && @HAVE_OS_H@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
527 # include <OS.h>
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
528 # if defined B_PAGE_SIZE
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
529 # define getpagesize() B_PAGE_SIZE
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
530 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
531 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
532 /* This is for AmigaOS4.0. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
533 # if !defined getpagesize && defined __amigaos4__
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
534 # define getpagesize() 2048
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
535 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
536 /* This is for older Unix systems. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
537 # if !defined getpagesize && @HAVE_SYS_PARAM_H@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
538 # include <sys/param.h>
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
539 # ifdef EXEC_PAGESIZE
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
540 # define getpagesize() EXEC_PAGESIZE
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
541 # else
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
542 # ifdef NBPG
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
543 # ifndef CLSIZE
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
544 # define CLSIZE 1
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
545 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
546 # define getpagesize() (NBPG * CLSIZE)
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
547 # else
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
548 # ifdef NBPC
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
549 # define getpagesize() NBPC
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
550 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
551 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
552 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
553 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
554 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
555 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
556 # undef getpagesize
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
557 # define getpagesize() \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
558 (GL_LINK_WARNING ("getpagesize is unportable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
559 "use gnulib module getpagesize for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
560 getpagesize ())
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
561 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
562
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
563
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
564 #if @GNULIB_GETUSERSHELL@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
565 # if !@HAVE_GETUSERSHELL@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
566 /* Return the next valid login shell on the system, or NULL when the end of
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
567 the list has been reached. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
568 extern char *getusershell (void);
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
569 /* Rewind to pointer that is advanced at each getusershell() call. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
570 extern void setusershell (void);
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
571 /* Free the pointer that is advanced at each getusershell() call and
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
572 associated resources. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
573 extern void endusershell (void);
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
574 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
575 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
576 # undef getusershell
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
577 # define getusershell() \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
578 (GL_LINK_WARNING ("getusershell is unportable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
579 "use gnulib module getusershell for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
580 getusershell ())
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
581 # undef setusershell
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
582 # define setusershell() \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
583 (GL_LINK_WARNING ("setusershell is unportable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
584 "use gnulib module getusershell for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
585 setusershell ())
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
586 # undef endusershell
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
587 # define endusershell() \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
588 (GL_LINK_WARNING ("endusershell is unportable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
589 "use gnulib module getusershell for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
590 endusershell ())
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
591 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
592
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
593
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
594 #if @GNULIB_LCHOWN@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
595 # if @REPLACE_LCHOWN@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
596 # undef lchown
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
597 # define lchown rpl_lchown
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
598 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
599 # if !@HAVE_LCHOWN@ || @REPLACE_LCHOWN@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
600 /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
601 to GID (if GID is not -1). Do not follow symbolic links.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
602 Return 0 if successful, otherwise -1 and errno set.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
603 See the POSIX:2001 specification
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
604 <http://www.opengroup.org/susv3xsh/lchown.html>. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
605 extern int lchown (char const *file, uid_t owner, gid_t group)
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
606 _GL_ARG_NONNULL ((1));
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
607 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
608 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
609 # undef lchown
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
610 # define lchown(f,u,g) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
611 (GL_LINK_WARNING ("lchown is unportable to pre-POSIX.1-2001 " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
612 "systems - use gnulib module lchown for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
613 lchown (f, u, g))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
614 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
615
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
616
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
617 #if @GNULIB_LINK@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
618 # if @REPLACE_LINK@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
619 # define link rpl_link
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
620 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
621 /* Create a new hard link for an existing file.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
622 Return 0 if successful, otherwise -1 and errno set.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
623 See POSIX:2001 specification
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
624 <http://www.opengroup.org/susv3xsh/link.html>. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
625 # if !@HAVE_LINK@ || @REPLACE_LINK@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
626 extern int link (const char *path1, const char *path2)
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
627 _GL_ARG_NONNULL ((1, 2));
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
628 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
629 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
630 # undef link
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
631 # define link(path1,path2) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
632 (GL_LINK_WARNING ("link is unportable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
633 "use gnulib module link for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
634 link (path1, path2))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
635 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
636
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
637 #if @GNULIB_LINKAT@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
638 # if @REPLACE_LINKAT@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
639 # undef linkat
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
640 # define linkat rpl_linkat
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
641 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
642 /* Create a new hard link for an existing file, relative to two
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
643 directories. FLAG controls whether symlinks are followed.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
644 Return 0 if successful, otherwise -1 and errno set. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
645 # if !@HAVE_LINKAT@ || @REPLACE_LINKAT@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
646 extern int linkat (int fd1, const char *path1, int fd2, const char *path2,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
647 int flag)
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
648 _GL_ARG_NONNULL ((2, 4));
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
649 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
650 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
651 # undef linkat
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
652 # define linkat(f1,path1,f2,path2,f) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
653 (GL_LINK_WARNING ("linkat is unportable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
654 "use gnulib module linkat for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
655 linkat (f1, path1, f2, path2,f))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
656 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
657
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
658 #if @GNULIB_LSEEK@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
659 # if @REPLACE_LSEEK@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
660 /* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
661 Return the new offset if successful, otherwise -1 and errno set.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
662 See the POSIX:2001 specification
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
663 <http://www.opengroup.org/susv3xsh/lseek.html>. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
664 # define lseek rpl_lseek
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
665 extern off_t lseek (int fd, off_t offset, int whence);
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
666 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
667 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
668 # undef lseek
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
669 # define lseek(f,o,w) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
670 (GL_LINK_WARNING ("lseek does not fail with ESPIPE on pipes on some " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
671 "systems - use gnulib module lseek for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
672 lseek (f, o, w))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
673 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
674
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
675
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
676 #if @GNULIB_PIPE2@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
677 /* Create a pipe, applying the given flags when opening the read-end of the
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
678 pipe and the write-end of the pipe.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
679 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
680 and O_TEXT, O_BINARY (defined in "binary-io.h").
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
681 Store the read-end as fd[0] and the write-end as fd[1].
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
682 Return 0 upon success, or -1 with errno set upon failure.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
683 See also the Linux man page at
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
684 <http://www.kernel.org/doc/man-pages/online/pages/man2/pipe2.2.html>. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
685 # if @HAVE_PIPE2@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
686 # define pipe2 rpl_pipe2
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
687 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
688 extern int pipe2 (int fd[2], int flags) _GL_ARG_NONNULL ((1));
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
689 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
690 # undef pipe2
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
691 # define pipe2(f,o) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
692 (GL_LINK_WARNING ("pipe2 is unportable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
693 "use gnulib module pipe2 for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
694 pipe2 (f, o))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
695 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
696
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
697
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
698 #if @GNULIB_PREAD@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
699 # if @REPLACE_PREAD@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
700 # define pread rpl_pread
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
701 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
702 /* Read at most BUFSIZE bytes from FD into BUF, starting at OFFSET.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
703 Return the number of bytes placed into BUF if successful, otherwise
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
704 set errno and return -1. 0 indicates EOF. See the POSIX:2001
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
705 specification <http://www.opengroup.org/susv3xsh/pread.html>. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
706 # if !@HAVE_PREAD@ || @REPLACE_PREAD@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
707 extern ssize_t pread (int fd, void *buf, size_t bufsize, off_t offset)
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
708 _GL_ARG_NONNULL ((2));
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
709 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
710 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
711 # undef pread
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
712 # define pread(f,b,s,o) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
713 (GL_LINK_WARNING ("pread is unportable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
714 "use gnulib module pread for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
715 pread (f, b, s, o))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
716 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
717
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
718
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
719 #if @GNULIB_READLINK@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
720 # if @REPLACE_READLINK@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
721 # define readlink rpl_readlink
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
722 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
723 /* Read the contents of the symbolic link FILE and place the first BUFSIZE
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
724 bytes of it into BUF. Return the number of bytes placed into BUF if
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
725 successful, otherwise -1 and errno set.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
726 See the POSIX:2001 specification
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
727 <http://www.opengroup.org/susv3xsh/readlink.html>. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
728 # if !@HAVE_READLINK@ || @REPLACE_READLINK@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
729 extern ssize_t readlink (const char *file, char *buf, size_t bufsize)
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
730 _GL_ARG_NONNULL ((1, 2));
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
731 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
732 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
733 # undef readlink
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
734 # define readlink(f,b,s) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
735 (GL_LINK_WARNING ("readlink is unportable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
736 "use gnulib module readlink for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
737 readlink (f, b, s))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
738 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
739
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
740
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
741 #if @GNULIB_READLINKAT@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
742 # if !@HAVE_READLINKAT@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
743 extern ssize_t readlinkat (int fd, char const *file, char *buf, size_t len)
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
744 _GL_ARG_NONNULL ((2, 3));
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
745 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
746 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
747 # undef readlinkat
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
748 # define readlinkat(d,n,b,l) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
749 (GL_LINK_WARNING ("readlinkat is not portable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
750 "use gnulib module symlinkat for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
751 readlinkat (d, n, b, l))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
752 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
753
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
754
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
755 #if @GNULIB_RMDIR@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
756 # if @REPLACE_RMDIR@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
757 # define rmdir rpl_rmdir
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
758 /* Remove the directory DIR. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
759 extern int rmdir (char const *name) _GL_ARG_NONNULL ((1));
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
760 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
761 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
762 # undef rmdir
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
763 # define rmdir(n) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
764 (GL_LINK_WARNING ("rmdir is unportable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
765 "use gnulib module rmdir for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
766 rmdir (n))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
767 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
768
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
769
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
770 #if @GNULIB_SLEEP@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
771 # if @REPLACE_SLEEP@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
772 # undef sleep
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
773 # define sleep rpl_sleep
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
774 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
775 /* Pause the execution of the current thread for N seconds.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
776 Returns the number of seconds left to sleep.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
777 See the POSIX:2001 specification
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
778 <http://www.opengroup.org/susv3xsh/sleep.html>. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
779 # if !@HAVE_SLEEP@ || @REPLACE_SLEEP@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
780 extern unsigned int sleep (unsigned int n);
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
781 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
782 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
783 # undef sleep
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
784 # define sleep(n) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
785 (GL_LINK_WARNING ("sleep is unportable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
786 "use gnulib module sleep for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
787 sleep (n))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
788 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
789
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
790
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
791 #if @GNULIB_SYMLINK@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
792 # if @REPLACE_SYMLINK@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
793 # undef symlink
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
794 # define symlink rpl_symlink
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
795 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
796 # if !@HAVE_SYMLINK@ || @REPLACE_SYMLINK@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
797 extern int symlink (char const *contents, char const *file)
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
798 _GL_ARG_NONNULL ((1, 2));
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
799 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
800 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
801 # undef symlink
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
802 # define symlink(c,n) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
803 (GL_LINK_WARNING ("symlink is not portable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
804 "use gnulib module symlink for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
805 symlink (c, n))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
806 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
807
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
808
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
809 #if @GNULIB_SYMLINKAT@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
810 # if !@HAVE_SYMLINKAT@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
811 extern int symlinkat (char const *contents, int fd, char const *file)
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
812 _GL_ARG_NONNULL ((1, 3));
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
813 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
814 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
815 # undef symlinkat
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
816 # define symlinkat(c,d,n) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
817 (GL_LINK_WARNING ("symlinkat is not portable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
818 "use gnulib module symlinkat for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
819 symlinkat (c, d, n))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
820 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
821
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
822
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
823 #if @GNULIB_UNLINK@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
824 # if @REPLACE_UNLINK@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
825 # undef unlink
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
826 # define unlink rpl_unlink
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
827 extern int unlink (char const *file) _GL_ARG_NONNULL ((1));
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
828 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
829 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
830 # undef unlink
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
831 # define unlink(n) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
832 (GL_LINK_WARNING ("unlink is not portable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
833 "use gnulib module unlink for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
834 unlink (n))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
835 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
836
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
837
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
838 #if @GNULIB_UNLINKAT@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
839 # if @REPLACE_UNLINKAT@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
840 # undef unlinkat
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
841 # define unlinkat rpl_unlinkat
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
842 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
843 # if !@HAVE_UNLINKAT@ || @REPLACE_UNLINKAT@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
844 extern int unlinkat (int fd, char const *file, int flag) _GL_ARG_NONNULL ((2));
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
845 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
846 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
847 # undef unlinkat
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
848 # define unlinkat(d,n,f) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
849 (GL_LINK_WARNING ("unlinkat is not portable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
850 "use gnulib module openat for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
851 unlinkat (d, n, f))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
852 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
853
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
854
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
855 #if @GNULIB_USLEEP@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
856 # if @REPLACE_USLEEP@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
857 # undef usleep
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
858 # define usleep rpl_usleep
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
859 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
860 # if !@HAVE_USLEEP@ || @REPLACE_USLEEP@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
861 /* Pause the execution of the current thread for N microseconds.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
862 Returns 0 on completion, or -1 on range error.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
863 See the POSIX:2001 specification
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
864 <http://www.opengroup.org/susv3xsh/sleep.html>. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
865 extern int usleep (useconds_t n);
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
866 # endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
867 #elif defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
868 # undef usleep
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
869 # define usleep(n) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
870 (GL_LINK_WARNING ("usleep is unportable - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
871 "use gnulib module usleep for portability"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
872 usleep (n))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
873 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
874
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
875
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
876 #if @GNULIB_WRITE@ && @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
877 /* Write up to COUNT bytes starting at BUF to file descriptor FD.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
878 See the POSIX:2001 specification
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
879 <http://www.opengroup.org/susv3xsh/write.html>. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
880 # undef write
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
881 # define write rpl_write
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
882 extern ssize_t write (int fd, const void *buf, size_t count)
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
883 _GL_ARG_NONNULL ((2));
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
884 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
885
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
886
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
887 #ifdef __cplusplus
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
888 }
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
889 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
890
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
891
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
892 #endif /* _GL_UNISTD_H */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
893 #endif /* _GL_UNISTD_H */