Merge illumos-gate
[unleashed.git] / include / unistd.h
blobb1d9c2602edfc483dd92483b793d42abb98914f6
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
23 * Copyright 2014 PALO, Richard.
24 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
25 * Copyright (c) 2013 Gary Mills
27 * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
30 /* Copyright (c) 1988 AT&T */
31 /* All Rights Reserved */
33 /* Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. */
35 #ifndef _UNISTD_H
36 #define _UNISTD_H
38 #include <sys/feature_tests.h>
40 #include <sys/null.h>
41 #include <sys/types.h>
42 #include <sys/unistd.h>
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
48 /* Symbolic constants for the "access" routine: */
49 #define R_OK 4 /* Test for Read permission */
50 #define W_OK 2 /* Test for Write permission */
51 #define X_OK 1 /* Test for eXecute permission */
52 #define F_OK 0 /* Test for existence of File */
54 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
55 #define F_ULOCK 0 /* Unlock a previously locked region */
56 #define F_LOCK 1 /* Lock a region for exclusive use */
57 #define F_TLOCK 2 /* Test and lock a region for exclusive use */
58 #define F_TEST 3 /* Test a region for other processes locks */
59 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
61 /* Symbolic constants for the "lseek" routine: */
63 #ifndef SEEK_SET
64 #define SEEK_SET 0 /* Set file pointer to "offset" */
65 #endif
67 #ifndef SEEK_CUR
68 #define SEEK_CUR 1 /* Set file pointer to current plus "offset" */
69 #endif
71 #ifndef SEEK_END
72 #define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
73 #endif
75 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
76 #ifndef SEEK_DATA
77 #define SEEK_DATA 3 /* Set file pointer to next data past offset */
78 #endif
80 #ifndef SEEK_HOLE
81 #define SEEK_HOLE 4 /* Set file pointer to next hole past offset */
82 #endif
83 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
85 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
86 /* Path names: */
87 #define GF_PATH "/etc/group" /* Path name of the "group" file */
88 #define PF_PATH "/etc/passwd" /* Path name of the "passwd" file */
89 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
92 * compile-time symbolic constants,
93 * Support does not mean the feature is enabled.
94 * Use pathconf/sysconf to obtain actual configuration value.
97 /* Values unchanged in UNIX 03 */
98 #define _POSIX_ASYNC_IO 1
99 #define _POSIX_JOB_CONTROL 1
100 #define _POSIX_SAVED_IDS 1
101 #define _POSIX_SYNC_IO 1
104 * POSIX.1b compile-time symbolic constants.
106 #if defined(_XPG6)
107 #define _POSIX_ASYNCHRONOUS_IO 200112L
108 #define _POSIX_FSYNC 200112L
109 #define _POSIX_MAPPED_FILES 200112L
110 #define _POSIX_MEMLOCK 200112L
111 #define _POSIX_MEMLOCK_RANGE 200112L
112 #define _POSIX_MEMORY_PROTECTION 200112L
113 #define _POSIX_MESSAGE_PASSING 200112L
114 #define _POSIX_PRIORITY_SCHEDULING 200112L
115 #define _POSIX_REALTIME_SIGNALS 200112L
116 #define _POSIX_SEMAPHORES 200112L
117 #define _POSIX_SHARED_MEMORY_OBJECTS 200112L
118 #define _POSIX_SYNCHRONIZED_IO 200112L
119 #else
120 #define _POSIX_ASYNCHRONOUS_IO 1
121 #define _POSIX_FSYNC 1
122 #define _POSIX_MAPPED_FILES 1
123 #define _POSIX_MEMLOCK 1
124 #define _POSIX_MEMLOCK_RANGE 1
125 #define _POSIX_MEMORY_PROTECTION 1
126 #define _POSIX_MESSAGE_PASSING 1
127 #define _POSIX_PRIORITY_SCHEDULING 1
128 #define _POSIX_REALTIME_SIGNALS 1
129 #define _POSIX_SEMAPHORES 1
130 #define _POSIX_SHARED_MEMORY_OBJECTS 1
131 #define _POSIX_SYNCHRONIZED_IO 1
132 #endif
135 * POSIX.1c compile-time symbolic constants.
137 #if defined(_XPG6)
138 #define _POSIX_THREAD_SAFE_FUNCTIONS 200112L
139 #define _POSIX_THREADS 200112L
140 #define _POSIX_THREAD_ATTR_STACKADDR 200112L
141 #define _POSIX_THREAD_ATTR_STACKSIZE 200112L
142 #define _POSIX_THREAD_PROCESS_SHARED 200112L
143 #define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L
144 #define _POSIX_TIMERS 200112L
145 #else
146 #define _POSIX_THREAD_SAFE_FUNCTIONS 1
147 #define _POSIX_THREADS 1
148 #define _POSIX_THREAD_ATTR_STACKADDR 1
149 #define _POSIX_THREAD_ATTR_STACKSIZE 1
150 #define _POSIX_THREAD_PROCESS_SHARED 1
151 #define _POSIX_THREAD_PRIORITY_SCHEDULING 1
152 #define _POSIX_TIMERS 1
153 #endif
155 /* New in UNIX 03 */
156 #define _POSIX_ADVISORY_INFO 200112L
157 #define _POSIX_BARRIERS 200112L
158 #define _POSIX_CLOCK_SELECTION 200112L
159 #define _POSIX_IPV6 200112L
160 #define _POSIX_MONOTONIC_CLOCK 200112L
161 #define _POSIX_RAW_SOCKETS 200112L
162 #define _POSIX_READER_WRITER_LOCKS 200112L
163 #define _POSIX_SPAWN 200112L
164 #define _POSIX_SPIN_LOCKS 200112L
165 #define _POSIX_TIMEOUTS 200112L
168 * Support for the POSIX.1 mutex protocol attribute. For realtime applications
169 * which need mutexes to support priority inheritance/ceiling.
171 #if defined(_XPG6)
172 #define _POSIX_THREAD_PRIO_INHERIT 200112L
173 #define _POSIX_THREAD_PRIO_PROTECT 200112L
174 #else
175 #define _POSIX_THREAD_PRIO_INHERIT 1
176 #define _POSIX_THREAD_PRIO_PROTECT 1
177 #endif
179 #ifndef _POSIX_VDISABLE
180 #define _POSIX_VDISABLE 0
181 #endif
183 #define STDIN_FILENO 0
184 #define STDOUT_FILENO 1
185 #define STDERR_FILENO 2
188 * Large File Summit-related announcement macros. The system supports both
189 * the additional and transitional Large File Summit interfaces. (The final
190 * two macros provide a finer granularity breakdown of _LFS64_LARGEFILE.)
192 #define _LFS_LARGEFILE 1
193 #define _LFS64_LARGEFILE 1
194 #define _LFS64_STDIO 1
195 #define _LFS64_ASYNCHRONOUS_IO 1
197 /* FIXME: source compat: these libc syms are aliases to non-64 ones */
198 off_t lseek64(int, off_t, int);
199 int ftruncate64(int, off_t);
200 ssize_t pread64(int, void *, size_t, off_t);
201 ssize_t pwrite64(int, const void *, size_t, off_t);
203 extern int access(const char *, int);
204 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
205 extern int acct(const char *);
206 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
207 extern unsigned alarm(unsigned);
208 /* Marked as LEGACY in SUSv2 and removed in SUSv3 */
209 #if !defined(__XOPEN_OR_POSIX) || (defined(_XPG4_2) && !defined(_XPG6)) || \
210 defined(__EXTENSIONS__)
211 extern int brk(void *);
212 #endif /* !defined(__XOPEN_OR_POSIX) || (defined(_XPG4_2)... */
213 extern int chdir(const char *);
214 extern int chown(const char *, uid_t, gid_t);
215 /* Marked as LEGACY in SUSv2 and removed in SUSv3 */
216 #if !defined(_POSIX_C_SOURCE) || (defined(_XOPEN_SOURCE) && \
217 !defined(_XPG6)) || defined(__EXTENSIONS__)
218 extern int chroot(const char *);
219 #endif /* !defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE))... */
220 extern int close(int);
221 #if defined(_XPG4) || defined(__EXTENSIONS__)
222 extern size_t confstr(int, char *, size_t);
223 extern char *crypt(const char *, const char *);
224 #endif /* defined(_XPG4) || defined(__EXTENSIONS__) */
225 #if !defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
226 defined(__EXTENSIONS__)
227 extern char *ctermid(char *);
228 #endif /* (!defined(_POSIX_C_SOURCE) ... */
229 extern char *ctermid_r(char *);
230 /* Marked as LEGACY in SUSv2 and removed in SUSv3 */
231 #if !defined(_XPG6) || defined(__EXTENSIONS__)
232 extern char *cuserid(char *);
233 #endif
234 extern int dup(int);
235 extern int dup2(int, int);
236 extern int dup3(int, int, int);
237 #if defined(_XPG4) || defined(__EXTENSIONS__)
238 extern void encrypt(char *, int);
239 #endif /* defined(XPG4) || defined(__EXTENSIONS__) */
240 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
241 extern void endusershell(void);
242 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
243 extern int execl(const char *, const char *, ...);
244 extern int execle(const char *, const char *, ...);
245 extern int execlp(const char *, const char *, ...);
246 extern int execv(const char *, char *const *);
247 extern int execve(const char *, char *const *, char *const *);
248 extern int execvp(const char *, char *const *);
249 #if defined(_GNU_SOURCE) || defined(__EXTENSIONS__)
250 extern int execvpe(const char *, char *const *, char *const *);
251 #endif
252 extern void _exit(int)
253 __NORETURN;
255 * The following fattach prototype is duplicated in <stropts.h>. The
256 * duplication is necessitated by XPG4.2 which requires the prototype
257 * be defined in <stropts.h>.
259 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
260 extern int fattach(int, const char *);
261 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
262 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
263 extern int fchdir(int);
264 extern int fchown(int, uid_t, gid_t);
265 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
266 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
267 extern int fchroot(int);
268 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
269 #if !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2) || \
270 defined(__EXTENSIONS__)
271 extern int fdatasync(int);
272 #endif /* !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2)... */
274 * The following fdetach prototype is duplicated in <stropts.h>. The
275 * duplication is necessitated by XPG4.2 which requires the prototype
276 * be defined in <stropts.h>.
278 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
279 extern int fdetach(const char *);
280 #endif /* !defined(__XOPEN_OR_POSIX)... */
281 extern pid_t fork(void);
282 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
283 extern pid_t fork1(void);
284 extern pid_t forkall(void);
285 #endif /* !defined(__XOPEN_OR_POSIX)... */
286 extern long fpathconf(int, int);
287 #if !defined(_POSIX_C_SOURCE) || (_POSIX_C_SOURCE > 2) || \
288 defined(__EXTENSIONS__)
289 extern int fsync(int);
290 #endif /* !defined(_POSIX_C_SOURCE) || (_POSIX_C_SOURCE > 2)... */
291 extern int ftruncate(int, off_t);
292 extern char *getcwd(char *, size_t);
293 #if !defined(__XOPEN_OR_POSIX) || (defined(_XPG4_2) && !defined(_XPG6)) || \
294 defined(__EXTENSIONS__)
295 extern int getdtablesize(void);
296 #endif
297 extern gid_t getegid(void);
298 extern uid_t geteuid(void);
299 extern gid_t getgid(void);
300 extern int getgroups(int, gid_t *);
301 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
302 extern long gethostid(void);
303 #endif
304 extern int gethostname(char *, size_t);
306 #ifndef __GETLOGIN_DEFINED /* Avoid duplicate in stdlib.h */
307 extern char *getlogin(void);
308 #endif /* __GETLOGIN_DEFINED */
310 #if defined(_XPG4) || defined(__EXTENSIONS__)
311 extern int getopt(int, char *const *, const char *);
312 extern char *optarg;
313 extern int opterr, optind, optopt;
314 /* Marked as LEGACY in SUSv2 and removed in SUSv3 */
315 #if !defined(_XPG6) || defined(__EXTENSIONS__)
316 extern char *getpass(const char *);
317 #endif
318 #endif /* defined(_XPG4) || defined(__EXTENSIONS__) */
319 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
320 /* Marked as LEGACY in SUSv2 and removed in SUSv3 */
321 #if !defined(_XPG6) || defined(__EXTENSIONS__)
322 extern int getpagesize(void);
323 #endif
324 extern pid_t getpgid(pid_t);
325 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
326 extern pid_t getpid(void);
327 extern pid_t getppid(void);
328 extern pid_t getpgrp(void);
330 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
331 char *gettxt(const char *, const char *);
332 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
333 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
334 extern pid_t getsid(pid_t);
335 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
336 extern uid_t getuid(void);
337 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
338 extern char *getusershell(void);
339 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
341 * The following ioctl prototype is duplicated in <stropts.h>. The
342 * duplication is necessitated by XPG4.2 which requires the prototype
343 * be defined in <stropts.h>.
345 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
346 extern int ioctl(int, int, ...);
347 extern int isaexec(const char *, char *const *, char *const *);
348 extern int issetugid(void);
349 #endif
350 extern int isatty(int);
351 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
352 extern int lchown(const char *, uid_t, gid_t);
353 #endif
354 extern int link(const char *, const char *);
355 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
356 extern offset_t llseek(int, offset_t, int);
357 #endif
358 extern int lockf(int, int, off_t);
359 extern off_t lseek(int, off_t, int);
360 #if !defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
361 defined(__EXTENSIONS__)
362 extern int nice(int);
363 #endif /* !defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)... */
364 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
365 extern int mincore(caddr_t, size_t, char *);
366 #endif
367 extern long pathconf(const char *, int);
368 extern int pause(void);
369 extern int pipe(int *);
370 extern int pipe2(int *, int);
371 extern ssize_t pread(int, void *, size_t, off_t);
372 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
373 extern void profil(unsigned short *, size_t, unsigned long, unsigned int);
374 #endif
376 * pthread_atfork() is also declared in <pthread.h> as per SUSv3. The
377 * declarations are identical. A change to either one may also require
378 * appropriate namespace updates in order to avoid redeclaration
379 * warnings in the case where both prototypes are exposed via inclusion
380 * of both <pthread.h> and <unistd.h>.
382 #if !defined(__XOPEN_OR_POSIX) || \
383 ((_POSIX_C_SOURCE > 2) && !defined(_XPG6)) || \
384 defined(__EXTENSIONS__)
385 extern int pthread_atfork(void (*) (void), void (*) (void), void (*) (void));
386 #endif /* !defined(__XOPEN_OR_POSIX) || ((_POSIX_C_SOURCE > 2) ... */
387 #if !defined(_LP64) && \
388 (!defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__))
389 extern int ptrace(int, pid_t, int, int);
390 #endif
391 extern ssize_t pwrite(int, const void *, size_t, off_t);
392 extern ssize_t read(int, void *, size_t);
393 #if !defined(__XOPEN_OR_POSIX) || \
394 defined(_XPG4_2) || defined(__EXTENSIONS__)
395 extern ssize_t readlink(const char *_RESTRICT_KYWD, char *_RESTRICT_KYWD,
396 size_t);
397 #endif
398 #if (!defined(__XOPEN_OR_POSIX) || (defined(_XPG3) && !defined(_XPG4))) || \
399 defined(__EXTENSIONS__)
400 #if __cplusplus >= 199711L
401 namespace std {
402 #endif
403 extern int rename(const char *, const char *);
404 #if __cplusplus >= 199711L
405 } /* end of namespace std */
407 using std::rename;
408 #endif /* __cplusplus >= 199711L */
409 #endif /* (!defined(__XOPEN_OR_POSIX) || (defined(_XPG3)... */
410 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
411 extern int resolvepath(const char *, char *, size_t);
412 #endif /* !defined(__XOPEN_OR_POSIX)|| defined(__EXTENSIONS__) */
413 extern int rmdir(const char *);
415 #if !defined(__XOPEN_OR_POSIX) || (defined(_XPG4_2) && !defined(_XPG6)) || \
416 defined(__EXTENSIONS__)
417 extern void *sbrk(intptr_t);
418 #endif /* !defined(__XOPEN_OR_POSIX) || (defined(_XPG4_2)... */
419 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
420 extern int setegid(gid_t);
421 extern int seteuid(uid_t);
422 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG6) ... */
423 extern int setgid(gid_t);
424 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
425 extern int setgroups(int, const gid_t *);
426 extern int sethostname(char *, int);
427 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
428 extern int setpgid(pid_t, pid_t);
429 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
430 extern pid_t setpgrp(void);
431 extern int setregid(gid_t, gid_t);
432 extern int setreuid(uid_t, uid_t);
433 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
434 extern pid_t setsid(void);
435 extern int setuid(uid_t);
436 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
437 extern void setusershell(void);
438 #endif /* !defined(__XOPEN_OR_POSIX)|| defined(__EXTENSIONS__) */
439 extern unsigned sleep(unsigned);
440 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
441 extern int stime(const time_t *);
442 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
443 #if defined(_XPG4)
444 /* __EXTENSIONS__ makes the SVID Third Edition prototype in stdlib.h visible */
445 extern void swab(const void *_RESTRICT_KYWD, void *_RESTRICT_KYWD, ssize_t);
446 #endif /* defined(_XPG4) */
447 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
448 extern int symlink(const char *, const char *);
449 extern void sync(void);
450 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) */
451 #if defined(_XPG5) && !defined(_XPG6)
452 #ifdef __PRAGMA_REDEFINE_EXTNAME
453 #pragma redefine_extname sysconf __sysconf_xpg5
454 #else /* __PRAGMA_REDEFINE_EXTNAME */
455 #define sysconf __sysconf_xpg5
456 #endif /* __PRAGMA_REDEFINE_EXTNAME */
457 #endif /* defined(_XPG5) && !defined(_XPG6) */
458 extern long sysconf(int);
459 extern pid_t tcgetpgrp(int);
460 extern int tcsetpgrp(int, pid_t);
461 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
462 extern off_t tell(int);
463 #endif /* !defined(__XOPEN_OR_POSIX)... */
464 #if __XPG_VISIBLE >= 420
465 extern int truncate(const char *, off_t);
466 #endif
467 extern char *ttyname(int);
468 #if (defined(_XPG4_2) && !defined(_XPG7)) || !defined(_STRICT_SYMBOLS)
469 extern useconds_t ualarm(useconds_t, useconds_t);
470 #endif
471 extern int unlink(const char *);
472 #if (defined(_XPG4_2) && !defined(_XPG7)) || !defined(_STRICT_SYMBOLS)
473 extern char *getwd(char *);
474 extern int usleep(useconds_t);
475 extern pid_t vfork(void) __RETURNS_TWICE;
476 #pragma unknown_control_flow(vfork)
477 #endif
478 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
479 extern void vhangup(void);
480 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
481 extern ssize_t write(int, const void *, size_t);
482 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
483 extern void yield(void);
484 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
486 #if !defined(__XOPEN_OR_POSIX) || defined(_ATFILE_SOURCE) || \
487 defined(__EXTENSIONS__)
488 /* || defined(_XPG7) */
489 extern int faccessat(int, const char *, int, int);
490 extern int fchownat(int, const char *, uid_t, gid_t, int);
491 extern int linkat(int, const char *, int, const char *, int);
492 extern ssize_t readlinkat(int, const char *_RESTRICT_KYWD,
493 char *_RESTRICT_KYWD, size_t);
494 extern int renameat(int, const char *, int, const char *);
495 extern int symlinkat(const char *, int, const char *);
496 extern int unlinkat(int, const char *, int);
497 #endif /* !defined(__XOPEN_OR_POSIX) || defined(_ATFILE_SOURCE)... */
498 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
499 extern int get_nprocs(void);
500 extern int get_nprocs_conf(void);
501 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
503 extern int getlogin_r(char *, size_t);
504 extern int ttyname_r(int, char *, size_t);
506 #if !defined(_STRICT_SYMBOLS)
507 extern int getentropy(void *, size_t);
508 #endif /* !_STRICT_SYMBOLS */
510 #if __UNLEASHED_VISIBLE
511 extern mode_t getmode(const void *, mode_t);
512 extern void *setmode(const char *);
513 #endif
515 #ifdef __cplusplus
517 #endif
519 #endif /* _UNISTD_H */