~p-ch-e/gnuhello/gnuhello

« back to all changes in this revision

Viewing changes to gnulib/lib/unistd.in.h

  • Committer: Reuben Thomas
  • Date: 2011-12-17 11:23:38 UTC
  • Revision ID: rrt@sc3d.org-20111217112338-kurwdy8nu69g3t6f
Update gnulib and convert .cvsignore to .bzrignore.

        * gnulib: Update.
        * .bzrignore: Add.
        * .cvsignore: Remove.
        * contrib/.cvsignore: Likewise.
        * doc/.cvsignore: Likewise.
        * man/.cvsignore: Likewise.
        * po/.cvsignore: Likewise.
        * src/.cvsignore: Likewise.
        * tests/.cvsignore: Likewise.
        * build/mkinstalldirs: Remove: no longer needed.
        * po: Update.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
# define _GL_WINSOCK2_H_WITNESS
37
37
 
38
38
/* Normal invocation.  */
39
 
#elif !defined _GL_UNISTD_H
 
39
#elif !defined _@GUARD_PREFIX@_UNISTD_H
40
40
 
41
41
/* The include_next requires a split double-inclusion guard.  */
42
42
#if @HAVE_UNISTD_H@
51
51
# undef _GL_INCLUDING_WINSOCK2_H
52
52
#endif
53
53
 
54
 
#if !defined _GL_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H
55
 
#define _GL_UNISTD_H
 
54
#if !defined _@GUARD_PREFIX@_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H
 
55
#define _@GUARD_PREFIX@_UNISTD_H
56
56
 
57
57
/* NetBSD 5.0 mis-defines NULL.  Also get size_t.  */
58
58
#include <stddef.h>
75
75
#endif
76
76
 
77
77
/* mingw fails to declare _exit in <unistd.h>.  */
78
 
/* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>.  */
 
78
/* mingw, MSVC, BeOS, Haiku declare environ in <stdlib.h>, not in
 
79
   <unistd.h>.  */
79
80
/* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>.  */
80
81
/* But avoid namespace pollution on glibc systems.  */
81
82
#ifndef __GLIBC__
82
83
# include <stdlib.h>
83
84
#endif
84
85
 
85
 
/* mingw declares getcwd in <io.h>, not in <unistd.h>.  */
86
 
#if ((@GNULIB_GETCWD@ || defined GNULIB_POSIXCHECK) \
 
86
/* Native Windows platforms declare chdir, getcwd, rmdir in
 
87
   <io.h> and/or <direct.h>, not in <unistd.h>.  */
 
88
#if ((@GNULIB_CHDIR@ || @GNULIB_GETCWD@ || @GNULIB_RMDIR@ \
 
89
      || defined GNULIB_POSIXCHECK) \
87
90
     && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
88
 
# include <io.h>
 
91
# include <io.h>     /* mingw32, mingw64 */
 
92
# include <direct.h> /* mingw64, MSVC 9 */
89
93
#endif
90
94
 
91
95
/* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>.
97
101
# include <netdb.h>
98
102
#endif
99
103
 
100
 
#if (@GNULIB_WRITE@ || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \
 
104
/* MSVC defines off_t in <sys/types.h>.  */
 
105
#if !@HAVE_UNISTD_H@
 
106
/* Get off_t.  */
 
107
# include <sys/types.h>
 
108
#endif
 
109
 
 
110
#if (@GNULIB_READ@ || @GNULIB_WRITE@ \
 
111
     || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \
101
112
     || @GNULIB_PREAD@ || @GNULIB_PWRITE@ || defined GNULIB_POSIXCHECK)
102
113
/* Get ssize_t.  */
103
114
# include <sys/types.h>
116
127
/* The definition of _GL_WARN_ON_USE is copied here.  */
117
128
 
118
129
 
119
 
#if @GNULIB_GETHOSTNAME@
120
 
/* Get all possible declarations of gethostname().  */
121
 
# if @UNISTD_H_HAVE_WINSOCK2_H@
122
 
#  if !defined _GL_SYS_SOCKET_H
123
 
#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
124
 
#    undef socket
125
 
#    define socket              socket_used_without_including_sys_socket_h
126
 
#    undef connect
127
 
#    define connect             connect_used_without_including_sys_socket_h
128
 
#    undef accept
129
 
#    define accept              accept_used_without_including_sys_socket_h
130
 
#    undef bind
131
 
#    define bind                bind_used_without_including_sys_socket_h
132
 
#    undef getpeername
133
 
#    define getpeername         getpeername_used_without_including_sys_socket_h
134
 
#    undef getsockname
135
 
#    define getsockname         getsockname_used_without_including_sys_socket_h
136
 
#    undef getsockopt
137
 
#    define getsockopt          getsockopt_used_without_including_sys_socket_h
138
 
#    undef listen
139
 
#    define listen              listen_used_without_including_sys_socket_h
140
 
#    undef recv
141
 
#    define recv                recv_used_without_including_sys_socket_h
142
 
#    undef send
143
 
#    define send                send_used_without_including_sys_socket_h
144
 
#    undef recvfrom
145
 
#    define recvfrom            recvfrom_used_without_including_sys_socket_h
146
 
#    undef sendto
147
 
#    define sendto              sendto_used_without_including_sys_socket_h
148
 
#    undef setsockopt
149
 
#    define setsockopt          setsockopt_used_without_including_sys_socket_h
150
 
#    undef shutdown
151
 
#    define shutdown            shutdown_used_without_including_sys_socket_h
152
 
#   else
153
 
     _GL_WARN_ON_USE (socket,
154
 
                      "socket() used without including <sys/socket.h>");
155
 
     _GL_WARN_ON_USE (connect,
156
 
                      "connect() used without including <sys/socket.h>");
157
 
     _GL_WARN_ON_USE (accept,
158
 
                      "accept() used without including <sys/socket.h>");
159
 
     _GL_WARN_ON_USE (bind,
160
 
                      "bind() used without including <sys/socket.h>");
161
 
     _GL_WARN_ON_USE (getpeername,
162
 
                      "getpeername() used without including <sys/socket.h>");
163
 
     _GL_WARN_ON_USE (getsockname,
164
 
                      "getsockname() used without including <sys/socket.h>");
165
 
     _GL_WARN_ON_USE (getsockopt,
166
 
                      "getsockopt() used without including <sys/socket.h>");
167
 
     _GL_WARN_ON_USE (listen,
168
 
                      "listen() used without including <sys/socket.h>");
169
 
     _GL_WARN_ON_USE (recv,
170
 
                      "recv() used without including <sys/socket.h>");
171
 
     _GL_WARN_ON_USE (send,
172
 
                      "send() used without including <sys/socket.h>");
173
 
     _GL_WARN_ON_USE (recvfrom,
174
 
                      "recvfrom() used without including <sys/socket.h>");
175
 
     _GL_WARN_ON_USE (sendto,
176
 
                      "sendto() used without including <sys/socket.h>");
177
 
     _GL_WARN_ON_USE (setsockopt,
178
 
                      "setsockopt() used without including <sys/socket.h>");
179
 
     _GL_WARN_ON_USE (shutdown,
180
 
                      "shutdown() used without including <sys/socket.h>");
181
 
#   endif
 
130
/* Hide some function declarations from <winsock2.h>.  */
 
131
 
 
132
#if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@
 
133
# if !defined _@GUARD_PREFIX@_SYS_SOCKET_H
 
134
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
135
#   undef socket
 
136
#   define socket              socket_used_without_including_sys_socket_h
 
137
#   undef connect
 
138
#   define connect             connect_used_without_including_sys_socket_h
 
139
#   undef accept
 
140
#   define accept              accept_used_without_including_sys_socket_h
 
141
#   undef bind
 
142
#   define bind                bind_used_without_including_sys_socket_h
 
143
#   undef getpeername
 
144
#   define getpeername         getpeername_used_without_including_sys_socket_h
 
145
#   undef getsockname
 
146
#   define getsockname         getsockname_used_without_including_sys_socket_h
 
147
#   undef getsockopt
 
148
#   define getsockopt          getsockopt_used_without_including_sys_socket_h
 
149
#   undef listen
 
150
#   define listen              listen_used_without_including_sys_socket_h
 
151
#   undef recv
 
152
#   define recv                recv_used_without_including_sys_socket_h
 
153
#   undef send
 
154
#   define send                send_used_without_including_sys_socket_h
 
155
#   undef recvfrom
 
156
#   define recvfrom            recvfrom_used_without_including_sys_socket_h
 
157
#   undef sendto
 
158
#   define sendto              sendto_used_without_including_sys_socket_h
 
159
#   undef setsockopt
 
160
#   define setsockopt          setsockopt_used_without_including_sys_socket_h
 
161
#   undef shutdown
 
162
#   define shutdown            shutdown_used_without_including_sys_socket_h
 
163
#  else
 
164
    _GL_WARN_ON_USE (socket,
 
165
                     "socket() used without including <sys/socket.h>");
 
166
    _GL_WARN_ON_USE (connect,
 
167
                     "connect() used without including <sys/socket.h>");
 
168
    _GL_WARN_ON_USE (accept,
 
169
                     "accept() used without including <sys/socket.h>");
 
170
    _GL_WARN_ON_USE (bind,
 
171
                     "bind() used without including <sys/socket.h>");
 
172
    _GL_WARN_ON_USE (getpeername,
 
173
                     "getpeername() used without including <sys/socket.h>");
 
174
    _GL_WARN_ON_USE (getsockname,
 
175
                     "getsockname() used without including <sys/socket.h>");
 
176
    _GL_WARN_ON_USE (getsockopt,
 
177
                     "getsockopt() used without including <sys/socket.h>");
 
178
    _GL_WARN_ON_USE (listen,
 
179
                     "listen() used without including <sys/socket.h>");
 
180
    _GL_WARN_ON_USE (recv,
 
181
                     "recv() used without including <sys/socket.h>");
 
182
    _GL_WARN_ON_USE (send,
 
183
                     "send() used without including <sys/socket.h>");
 
184
    _GL_WARN_ON_USE (recvfrom,
 
185
                     "recvfrom() used without including <sys/socket.h>");
 
186
    _GL_WARN_ON_USE (sendto,
 
187
                     "sendto() used without including <sys/socket.h>");
 
188
    _GL_WARN_ON_USE (setsockopt,
 
189
                     "setsockopt() used without including <sys/socket.h>");
 
190
    _GL_WARN_ON_USE (shutdown,
 
191
                     "shutdown() used without including <sys/socket.h>");
182
192
#  endif
183
 
#  if !defined _GL_SYS_SELECT_H
184
 
#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
185
 
#    undef select
186
 
#    define select              select_used_without_including_sys_select_h
187
 
#   else
188
 
     _GL_WARN_ON_USE (select,
189
 
                      "select() used without including <sys/select.h>");
190
 
#   endif
 
193
# endif
 
194
# if !defined _@GUARD_PREFIX@_SYS_SELECT_H
 
195
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
196
#   undef select
 
197
#   define select              select_used_without_including_sys_select_h
 
198
#  else
 
199
    _GL_WARN_ON_USE (select,
 
200
                     "select() used without including <sys/select.h>");
191
201
#  endif
192
202
# endif
193
203
#endif
223
233
#endif
224
234
 
225
235
 
 
236
#if @GNULIB_CHDIR@
 
237
_GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1)));
 
238
_GL_CXXALIASWARN (chdir);
 
239
#elif defined GNULIB_POSIXCHECK
 
240
# undef chdir
 
241
# if HAVE_RAW_DECL_CHDIR
 
242
_GL_WARN_ON_USE (chown, "chdir is not always in <unistd.h> - "
 
243
                 "use gnulib module chdir for portability");
 
244
# endif
 
245
#endif
 
246
 
 
247
 
226
248
#if @GNULIB_CHOWN@
227
249
/* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
228
250
   to GID (if GID is not -1).  Follow symbolic links.
229
251
   Return 0 if successful, otherwise -1 and errno set.
230
 
   See the POSIX:2001 specification
231
 
   <http://www.opengroup.org/susv3xsh/chown.html>.  */
 
252
   See the POSIX:2008 specification
 
253
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/chown.html.  */
232
254
# if @REPLACE_CHOWN@
233
255
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
234
256
#   undef chown
279
301
#endif
280
302
 
281
303
 
282
 
#if @REPLACE_DUP@
283
 
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
284
 
#  define dup rpl_dup
285
 
# endif
 
304
#if @GNULIB_DUP@
 
305
# if @REPLACE_DUP@
 
306
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
307
#   define dup rpl_dup
 
308
#  endif
286
309
_GL_FUNCDECL_RPL (dup, int, (int oldfd));
287
310
_GL_CXXALIAS_RPL (dup, int, (int oldfd));
288
 
#else
 
311
# else
289
312
_GL_CXXALIAS_SYS (dup, int, (int oldfd));
290
 
#endif
 
313
# endif
291
314
_GL_CXXALIASWARN (dup);
 
315
#elif defined GNULIB_POSIXCHECK
 
316
# undef dup
 
317
# if HAVE_RAW_DECL_DUP
 
318
_GL_WARN_ON_USE (dup, "dup is unportable - "
 
319
                 "use gnulib module dup for portability");
 
320
# endif
 
321
#endif
292
322
 
293
323
 
294
324
#if @GNULIB_DUP2@
295
325
/* Copy the file descriptor OLDFD into file descriptor NEWFD.  Do nothing if
296
326
   NEWFD = OLDFD, otherwise close NEWFD first if it is open.
297
327
   Return newfd if successful, otherwise -1 and errno set.
298
 
   See the POSIX:2001 specification
299
 
   <http://www.opengroup.org/susv3xsh/dup2.html>.  */
 
328
   See the POSIX:2008 specification
 
329
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/dup2.html>.  */
300
330
# if @REPLACE_DUP2@
301
331
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
302
332
#   define dup2 rpl_dup2
425
455
/* Change the process' current working directory to the directory on which
426
456
   the given file descriptor is open.
427
457
   Return 0 if successful, otherwise -1 and errno set.
428
 
   See the POSIX:2001 specification
429
 
   <http://www.opengroup.org/susv3xsh/fchdir.html>.  */
 
458
   See the POSIX:2008 specification
 
459
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/fchdir.html>.  */
430
460
# if ! @HAVE_FCHDIR@
431
461
_GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/));
432
462
 
483
513
#endif
484
514
 
485
515
 
 
516
#if @GNULIB_FDATASYNC@
 
517
/* Synchronize changes to a file.
 
518
   Return 0 if successful, otherwise -1 and errno set.
 
519
   See POSIX:2008 specification
 
520
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html>.  */
 
521
# if !@HAVE_FDATASYNC@ || !@HAVE_DECL_FDATASYNC@
 
522
_GL_FUNCDECL_SYS (fdatasync, int, (int fd));
 
523
# endif
 
524
_GL_CXXALIAS_SYS (fdatasync, int, (int fd));
 
525
_GL_CXXALIASWARN (fdatasync);
 
526
#elif defined GNULIB_POSIXCHECK
 
527
# undef fdatasync
 
528
# if HAVE_RAW_DECL_FDATASYNC
 
529
_GL_WARN_ON_USE (fdatasync, "fdatasync is unportable - "
 
530
                 "use gnulib module fdatasync for portability");
 
531
# endif
 
532
#endif
 
533
 
 
534
 
486
535
#if @GNULIB_FSYNC@
487
 
/* Synchronize changes to a file.
 
536
/* Synchronize changes, including metadata, to a file.
488
537
   Return 0 if successful, otherwise -1 and errno set.
489
 
   See POSIX:2001 specification
490
 
   <http://www.opengroup.org/susv3xsh/fsync.html>.  */
 
538
   See POSIX:2008 specification
 
539
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html>.  */
491
540
# if !@HAVE_FSYNC@
492
541
_GL_FUNCDECL_SYS (fsync, int, (int fd));
493
542
# endif
505
554
#if @GNULIB_FTRUNCATE@
506
555
/* Change the size of the file to which FD is opened to become equal to LENGTH.
507
556
   Return 0 if successful, otherwise -1 and errno set.
508
 
   See the POSIX:2001 specification
509
 
   <http://www.opengroup.org/susv3xsh/ftruncate.html>.  */
 
557
   See the POSIX:2008 specification
 
558
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html>.  */
510
559
# if !@HAVE_FTRUNCATE@
511
560
_GL_FUNCDECL_SYS (ftruncate, int, (int fd, off_t length));
512
561
# endif
526
575
   of BUF.
527
576
   Return BUF if successful, or NULL if the directory couldn't be determined
528
577
   or SIZE was too small.
529
 
   See the POSIX:2001 specification
530
 
   <http://www.opengroup.org/susv3xsh/getcwd.html>.
 
578
   See the POSIX:2008 specification
 
579
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/getcwd.html>.
531
580
   Additionally, the gnulib module 'getcwd' guarantees the following GNU
532
581
   extension: If BUF is NULL, an array is allocated with 'malloc'; the array
533
582
   is SIZE bytes long, unless SIZE == 0, in which case it is as big as
870
919
#endif
871
920
 
872
921
 
 
922
#if @GNULIB_GROUP_MEMBER@
 
923
/* Determine whether group id is in calling user's group list.  */
 
924
# if !@HAVE_GROUP_MEMBER@
 
925
_GL_FUNCDECL_SYS (group_member, int, (gid_t gid));
 
926
# endif
 
927
_GL_CXXALIAS_SYS (group_member, int, (gid_t gid));
 
928
_GL_CXXALIASWARN (group_member);
 
929
#elif defined GNULIB_POSIXCHECK
 
930
# undef group_member
 
931
# if HAVE_RAW_DECL_GROUP_MEMBER
 
932
_GL_WARN_ON_USE (group_member, "group_member is unportable - "
 
933
                 "use gnulib module group-member for portability");
 
934
# endif
 
935
#endif
 
936
 
 
937
 
873
938
#if @GNULIB_LCHOWN@
874
939
/* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
875
940
   to GID (if GID is not -1).  Do not follow symbolic links.
876
941
   Return 0 if successful, otherwise -1 and errno set.
877
 
   See the POSIX:2001 specification
878
 
   <http://www.opengroup.org/susv3xsh/lchown.html>.  */
 
942
   See the POSIX:2008 specification
 
943
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/lchown.html>.  */
879
944
# if @REPLACE_LCHOWN@
880
945
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
881
946
#   undef lchown
904
969
#if @GNULIB_LINK@
905
970
/* Create a new hard link for an existing file.
906
971
   Return 0 if successful, otherwise -1 and errno set.
907
 
   See POSIX:2001 specification
908
 
   <http://www.opengroup.org/susv3xsh/link.html>.  */
 
972
   See POSIX:2008 specification
 
973
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html>.  */
909
974
# if @REPLACE_LINK@
910
975
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
911
976
#   define link rpl_link
970
1035
#if @GNULIB_LSEEK@
971
1036
/* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END.
972
1037
   Return the new offset if successful, otherwise -1 and errno set.
973
 
   See the POSIX:2001 specification
974
 
   <http://www.opengroup.org/susv3xsh/lseek.html>.  */
 
1038
   See the POSIX:2008 specification
 
1039
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html>.  */
975
1040
# if @REPLACE_LSEEK@
976
1041
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
977
1042
#   define lseek rpl_lseek
1041
1106
#if @GNULIB_PREAD@
1042
1107
/* Read at most BUFSIZE bytes from FD into BUF, starting at OFFSET.
1043
1108
   Return the number of bytes placed into BUF if successful, otherwise
1044
 
   set errno and return -1.  0 indicates EOF.  See the POSIX:2001
1045
 
   specification <http://www.opengroup.org/susv3xsh/pread.html>.  */
 
1109
   set errno and return -1.  0 indicates EOF.
 
1110
   See the POSIX:2008 specification
 
1111
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/pread.html>.  */
1046
1112
# if @REPLACE_PREAD@
1047
1113
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
1114
#   undef pread
1048
1115
#   define pread rpl_pread
1049
1116
#  endif
1050
1117
_GL_FUNCDECL_RPL (pread, ssize_t,
1075
1142
/* Write at most BUFSIZE bytes from BUF into FD, starting at OFFSET.
1076
1143
   Return the number of bytes written if successful, otherwise
1077
1144
   set errno and return -1.  0 indicates nothing written.  See the
1078
 
   POSIX:2001 specification
1079
 
   <http://www.opengroup.org/susv3xsh/pwrite.html>.  */
 
1145
   POSIX:2008 specification
 
1146
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/pwrite.html>.  */
1080
1147
# if @REPLACE_PWRITE@
1081
1148
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
1149
#   undef pwrite
1082
1150
#   define pwrite rpl_pwrite
1083
1151
#  endif
1084
1152
_GL_FUNCDECL_RPL (pwrite, ssize_t,
1105
1173
#endif
1106
1174
 
1107
1175
 
 
1176
#if @GNULIB_READ@
 
1177
/* Read up to COUNT bytes from file descriptor FD into the buffer starting
 
1178
   at BUF.  See the POSIX:2008 specification
 
1179
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html>.  */
 
1180
# if @REPLACE_READ@
 
1181
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
1182
#   undef read
 
1183
#   define read rpl_read
 
1184
#  endif
 
1185
_GL_FUNCDECL_RPL (read, ssize_t, (int fd, void *buf, size_t count)
 
1186
                                 _GL_ARG_NONNULL ((2)));
 
1187
_GL_CXXALIAS_RPL (read, ssize_t, (int fd, void *buf, size_t count));
 
1188
# else
 
1189
/* Need to cast, because on mingw, the third parameter is
 
1190
                                                          unsigned int count
 
1191
   and the return type is 'int'.  */
 
1192
_GL_CXXALIAS_SYS_CAST (read, ssize_t, (int fd, void *buf, size_t count));
 
1193
# endif
 
1194
_GL_CXXALIASWARN (read);
 
1195
#endif
 
1196
 
 
1197
 
1108
1198
#if @GNULIB_READLINK@
1109
1199
/* Read the contents of the symbolic link FILE and place the first BUFSIZE
1110
1200
   bytes of it into BUF.  Return the number of bytes placed into BUF if
1111
1201
   successful, otherwise -1 and errno set.
1112
 
   See the POSIX:2001 specification
1113
 
   <http://www.opengroup.org/susv3xsh/readlink.html>.  */
 
1202
   See the POSIX:2008 specification
 
1203
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html>.  */
1114
1204
# if @REPLACE_READLINK@
1115
1205
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1116
1206
#   define readlink rpl_readlink
1178
1268
#endif
1179
1269
 
1180
1270
 
 
1271
#if @GNULIB_SETHOSTNAME@
 
1272
/* Set the host name of the machine.
 
1273
   The host name may or may not be fully qualified.
 
1274
 
 
1275
   Put LEN bytes of NAME into the host name.
 
1276
   Return 0 if successful, otherwise, set errno and return -1.
 
1277
 
 
1278
   Platforms with no ability to set the hostname return -1 and set
 
1279
   errno = ENOSYS.  */
 
1280
# if !@HAVE_SETHOSTNAME@ || !@HAVE_DECL_SETHOSTNAME@
 
1281
_GL_FUNCDECL_SYS (sethostname, int, (const char *name, size_t len)
 
1282
                                    _GL_ARG_NONNULL ((1)));
 
1283
# endif
 
1284
/* Need to cast, because on Solaris 11 2011-10, MacOS X 10.5, IRIX 6.5
 
1285
   and FreeBSD 6.4 the second parameter is int.  On Solaris 11
 
1286
   2011-10, the first parameter is not const.  */
 
1287
_GL_CXXALIAS_SYS_CAST (sethostname, int, (const char *name, size_t len));
 
1288
_GL_CXXALIASWARN (sethostname);
 
1289
#elif defined GNULIB_POSIXCHECK
 
1290
# undef sethostname
 
1291
# if HAVE_RAW_DECL_SETHOSTNAME
 
1292
_GL_WARN_ON_USE (sethostname, "sethostname is unportable - "
 
1293
                 "use gnulib module sethostname for portability");
 
1294
# endif
 
1295
#endif
 
1296
 
 
1297
 
1181
1298
#if @GNULIB_SLEEP@
1182
1299
/* Pause the execution of the current thread for N seconds.
1183
1300
   Returns the number of seconds left to sleep.
1184
 
   See the POSIX:2001 specification
1185
 
   <http://www.opengroup.org/susv3xsh/sleep.html>.  */
 
1301
   See the POSIX:2008 specification
 
1302
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/sleep.html>.  */
1186
1303
# if @REPLACE_SLEEP@
1187
1304
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1188
1305
#   undef sleep
1331
1448
/* Pause the execution of the current thread for N microseconds.
1332
1449
   Returns 0 on completion, or -1 on range error.
1333
1450
   See the POSIX:2001 specification
1334
 
   <http://www.opengroup.org/susv3xsh/sleep.html>.  */
 
1451
   <http://www.opengroup.org/susv3xsh/usleep.html>.  */
1335
1452
# if @REPLACE_USLEEP@
1336
1453
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1337
1454
#   undef usleep
1357
1474
 
1358
1475
#if @GNULIB_WRITE@
1359
1476
/* Write up to COUNT bytes starting at BUF to file descriptor FD.
1360
 
   See the POSIX:2001 specification
1361
 
   <http://www.opengroup.org/susv3xsh/write.html>.  */
1362
 
# if @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@
 
1477
   See the POSIX:2008 specification
 
1478
   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html>.  */
 
1479
# if @REPLACE_WRITE@
1363
1480
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1364
1481
#   undef write
1365
1482
#   define write rpl_write
1377
1494
#endif
1378
1495
 
1379
1496
 
1380
 
#endif /* _GL_UNISTD_H */
1381
 
#endif /* _GL_UNISTD_H */
 
1497
#endif /* _@GUARD_PREFIX@_UNISTD_H */
 
1498
#endif /* _@GUARD_PREFIX@_UNISTD_H */