annotate lib/unistd.in.h @ 425:67815606c5d9 3.0-beta2

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