~ubuntu-branches/ubuntu/precise/wget/precise-proposed

« back to all changes in this revision

Viewing changes to lib/unistd.in.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2011-10-19 00:00:09 UTC
  • mfrom: (2.1.13 sid)
  • Revision ID: james.westby@ubuntu.com-20111019000009-8p33w3wz4b1rdri0
Tags: 1.13-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Add wget-udeb to ship wget.gnu as alternative to busybox wget
    implementation.
  - Depend on libssl-dev 0.9.8k-7ubuntu4 (LP: #503339)
* Dropped changes, superseded in Debian:
  - Keep build dependencies in main:
    + debian/control: remove info2man build-dep
    + debian/patches/series: disable wget-infopod_generated_manpage
  - Mark wget Multi-Arch: foreign, so packages that aren't of the same arch
    can depend on it.
* Pass --with-ssl=openssl; we don't want to use gnutls, there's no udeb for
  it.
* Add a second build pass for the udeb, so we can build without libidn.

Show diffs side-by-side

added added

removed removed

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