Source code pulled from OpenBSD for OpenNTPD. The place to contribute to this code is via the OpenBSD CVS tree.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

548 lines
18 KiB

  1. /* $OpenBSD: unistd.h,v 1.97 2014/12/13 20:42:41 tedu Exp $ */
  2. /* $NetBSD: unistd.h,v 1.26.4.1 1996/05/28 02:31:51 mrg Exp $ */
  3. /*-
  4. * Copyright (c) 1991 The Regents of the University of California.
  5. * All rights reserved.
  6. *
  7. * Redistribution and use in source and binary forms, with or without
  8. * modification, are permitted provided that the following conditions
  9. * are met:
  10. * 1. Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * 2. Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. * 3. Neither the name of the University nor the names of its contributors
  16. * may be used to endorse or promote products derived from this software
  17. * without specific prior written permission.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  20. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  21. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  22. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  23. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  24. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  25. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  26. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  27. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  28. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  29. * SUCH DAMAGE.
  30. *
  31. * @(#)unistd.h 5.13 (Berkeley) 6/17/91
  32. */
  33. #ifndef _UNISTD_H_
  34. #define _UNISTD_H_
  35. #include <sys/types.h>
  36. #include <sys/unistd.h>
  37. #define STDIN_FILENO 0 /* standard input file descriptor */
  38. #define STDOUT_FILENO 1 /* standard output file descriptor */
  39. #define STDERR_FILENO 2 /* standard error file descriptor */
  40. #if __XPG_VISIBLE || __POSIX_VISIBLE >= 200112
  41. #define F_ULOCK 0 /* unlock locked section */
  42. #define F_LOCK 1 /* lock a section for exclusive use */
  43. #define F_TLOCK 2 /* test and lock a section for exclusive use */
  44. #define F_TEST 3 /* test a section for locks by other procs */
  45. #endif
  46. /*
  47. * POSIX options and option groups we unconditionally do or don't
  48. * implement. Please keep this list in alphabetical order.
  49. *
  50. * Anything which is defined as zero below **must** have an
  51. * implementation for the corresponding sysconf() which is able to
  52. * determine conclusively whether or not the feature is supported.
  53. * Anything which is defined as other than -1 below **must** have
  54. * complete headers, types, and function declarations as specified by
  55. * the POSIX standard; however, if the relevant sysconf() function
  56. * returns -1, the functions may be stubbed out.
  57. */
  58. #define _POSIX_ADVISORY_INFO (-1)
  59. #define _POSIX_ASYNCHRONOUS_IO (-1)
  60. #define _POSIX_BARRIERS 200112L
  61. #define _POSIX_CHOWN_RESTRICTED 1
  62. #define _POSIX_CLOCK_SELECTION (-1)
  63. #define _POSIX_CPUTIME 200809L
  64. #define _POSIX_FSYNC 200112L
  65. #define _POSIX_IPV6 0
  66. #define _POSIX_JOB_CONTROL 1
  67. #define _POSIX_MAPPED_FILES 200112L
  68. #define _POSIX_MEMLOCK 200112L
  69. #define _POSIX_MEMLOCK_RANGE 200112L
  70. #define _POSIX_MEMORY_PROTECTION 200112L
  71. #define _POSIX_MESSAGE_PASSING (-1)
  72. #define _POSIX_MONOTONIC_CLOCK 200112L
  73. #define _POSIX_NO_TRUNC 1
  74. #define _POSIX_PRIORITIZED_IO (-1)
  75. #define _POSIX_PRIORITY_SCHEDULING (-1)
  76. #define _POSIX_RAW_SOCKETS 200112L
  77. #define _POSIX_READER_WRITER_LOCKS 200112L
  78. #define _POSIX_REALTIME_SIGNALS (-1)
  79. #define _POSIX_REGEXP 1
  80. #define _POSIX_SAVED_IDS 1
  81. #define _POSIX_SEMAPHORES 200112L
  82. #define _POSIX_SHARED_MEMORY_OBJECTS 200809L
  83. #define _POSIX_SHELL 1
  84. #define _POSIX_SPAWN 200112L
  85. #define _POSIX_SPIN_LOCKS 200112L
  86. #define _POSIX_SPORADIC_SERVER (-1)
  87. #define _POSIX_SYNCHRONIZED_IO (-1)
  88. #define _POSIX_THREAD_ATTR_STACKADDR 200112L
  89. #define _POSIX_THREAD_ATTR_STACKSIZE 200112L
  90. #define _POSIX_THREAD_CPUTIME 200809L
  91. #define _POSIX_THREAD_PRIO_INHERIT (-1)
  92. #define _POSIX_THREAD_PRIO_PROTECT (-1)
  93. #define _POSIX_THREAD_PRIORITY_SCHEDULING (-1)
  94. #define _POSIX_THREAD_PROCESS_SHARED (-1)
  95. #define _POSIX_THREAD_ROBUST_PRIO_INHERIT (-1)
  96. #define _POSIX_THREAD_ROBUST_PRIO_PROTECT (-1)
  97. #define _POSIX_THREAD_SAFE_FUNCTIONS 200112L
  98. #define _POSIX_THREAD_SPORADIC_SERVER (-1)
  99. #define _POSIX_THREADS 200112L
  100. #define _POSIX_TIMEOUTS 200112L
  101. #define _POSIX_TIMERS (-1)
  102. #define _POSIX_TRACE (-1)
  103. #define _POSIX_TRACE_EVENT_FILTER (-1)
  104. #define _POSIX_TRACE_INHERIT (-1)
  105. #define _POSIX_TRACE_LOG (-1)
  106. #define _POSIX_TYPED_MEMORY_OBJECTS (-1)
  107. #define _POSIX2_C_BIND 200112L
  108. #define _POSIX2_C_DEV (-1) /* need C99 utility */
  109. #define _POSIX2_CHAR_TERM 1
  110. #define _POSIX2_FORT_DEV (-1) /* need fort77 utility */
  111. #define _POSIX2_FORT_RUN (-1) /* need asa utility */
  112. #define _POSIX2_LOCALEDEF (-1)
  113. #define _POSIX2_PBS (-1)
  114. #define _POSIX2_PBS_ACCOUNTING (-1)
  115. #define _POSIX2_PBS_CHECKPOINT (-1)
  116. #define _POSIX2_PBS_LOCATE (-1)
  117. #define _POSIX2_PBS_MESSAGE (-1)
  118. #define _POSIX2_PBS_TRACK (-1)
  119. #define _POSIX2_SW_DEV 200112L
  120. #define _POSIX2_UPE 200112L
  121. #define _POSIX_V6_ILP32_OFF32 (-1)
  122. #define _POSIX_V6_ILP32_OFFBIG 0
  123. #define _POSIX_V6_LP64_OFF64 0
  124. #define _POSIX_V6_LPBIG_OFFBIG 0
  125. #define _POSIX_V7_ILP32_OFF32 (-1)
  126. #define _POSIX_V7_ILP32_OFFBIG 0
  127. #define _POSIX_V7_LP64_OFF64 0
  128. #define _POSIX_V7_LPBIG_OFFBIG 0
  129. #define _XOPEN_CRYPT 1
  130. #define _XOPEN_ENH_I18N (-1) /* mandatory in XSI */
  131. #define _XOPEN_LEGACY (-1)
  132. #define _XOPEN_REALTIME (-1)
  133. #define _XOPEN_REALTIME_THREADS (-1)
  134. #define _XOPEN_SHM 1
  135. #define _XOPEN_STREAMS (-1)
  136. #define _XOPEN_UUCP (-1)
  137. #define _XOPEN_UNIX (-1)
  138. /* Define the POSIX.2 version we target for compliance. */
  139. #define _POSIX2_VERSION 200809L
  140. /* the sysconf(3) variable values are part of the ABI */
  141. /* configurable system variables */
  142. #define _SC_ARG_MAX 1
  143. #define _SC_CHILD_MAX 2
  144. #define _SC_CLK_TCK 3
  145. #define _SC_NGROUPS_MAX 4
  146. #define _SC_OPEN_MAX 5
  147. #define _SC_JOB_CONTROL 6
  148. #define _SC_SAVED_IDS 7
  149. #define _SC_VERSION 8
  150. #define _SC_BC_BASE_MAX 9
  151. #define _SC_BC_DIM_MAX 10
  152. #define _SC_BC_SCALE_MAX 11
  153. #define _SC_BC_STRING_MAX 12
  154. #define _SC_COLL_WEIGHTS_MAX 13
  155. #define _SC_EXPR_NEST_MAX 14
  156. #define _SC_LINE_MAX 15
  157. #define _SC_RE_DUP_MAX 16
  158. #define _SC_2_VERSION 17
  159. #define _SC_2_C_BIND 18
  160. #define _SC_2_C_DEV 19
  161. #define _SC_2_CHAR_TERM 20
  162. #define _SC_2_FORT_DEV 21
  163. #define _SC_2_FORT_RUN 22
  164. #define _SC_2_LOCALEDEF 23
  165. #define _SC_2_SW_DEV 24
  166. #define _SC_2_UPE 25
  167. #define _SC_STREAM_MAX 26
  168. #define _SC_TZNAME_MAX 27
  169. #define _SC_PAGESIZE 28
  170. #define _SC_PAGE_SIZE _SC_PAGESIZE /* 1170 compatibility */
  171. #define _SC_FSYNC 29
  172. #define _SC_XOPEN_SHM 30
  173. #define _SC_SEM_NSEMS_MAX 31
  174. #define _SC_SEM_VALUE_MAX 32
  175. #define _SC_HOST_NAME_MAX 33
  176. #define _SC_MONOTONIC_CLOCK 34
  177. #define _SC_2_PBS 35
  178. #define _SC_2_PBS_ACCOUNTING 36
  179. #define _SC_2_PBS_CHECKPOINT 37
  180. #define _SC_2_PBS_LOCATE 38
  181. #define _SC_2_PBS_MESSAGE 39
  182. #define _SC_2_PBS_TRACK 40
  183. #define _SC_ADVISORY_INFO 41
  184. #define _SC_AIO_LISTIO_MAX 42
  185. #define _SC_AIO_MAX 43
  186. #define _SC_AIO_PRIO_DELTA_MAX 44
  187. #define _SC_ASYNCHRONOUS_IO 45
  188. #define _SC_ATEXIT_MAX 46
  189. #define _SC_BARRIERS 47
  190. #define _SC_CLOCK_SELECTION 48
  191. #define _SC_CPUTIME 49
  192. #define _SC_DELAYTIMER_MAX 50
  193. #define _SC_IOV_MAX 51
  194. #define _SC_IPV6 52
  195. #define _SC_MAPPED_FILES 53
  196. #define _SC_MEMLOCK 54
  197. #define _SC_MEMLOCK_RANGE 55
  198. #define _SC_MEMORY_PROTECTION 56
  199. #define _SC_MESSAGE_PASSING 57
  200. #define _SC_MQ_OPEN_MAX 58
  201. #define _SC_MQ_PRIO_MAX 59
  202. #define _SC_PRIORITIZED_IO 60
  203. #define _SC_PRIORITY_SCHEDULING 61
  204. #define _SC_RAW_SOCKETS 62
  205. #define _SC_READER_WRITER_LOCKS 63
  206. #define _SC_REALTIME_SIGNALS 64
  207. #define _SC_REGEXP 65
  208. #define _SC_RTSIG_MAX 66
  209. #define _SC_SEMAPHORES 67
  210. #define _SC_SHARED_MEMORY_OBJECTS 68
  211. #define _SC_SHELL 69
  212. #define _SC_SIGQUEUE_MAX 70
  213. #define _SC_SPAWN 71
  214. #define _SC_SPIN_LOCKS 72
  215. #define _SC_SPORADIC_SERVER 73
  216. #define _SC_SS_REPL_MAX 74
  217. #define _SC_SYNCHRONIZED_IO 75
  218. #define _SC_SYMLOOP_MAX 76
  219. #define _SC_THREAD_ATTR_STACKADDR 77
  220. #define _SC_THREAD_ATTR_STACKSIZE 78
  221. #define _SC_THREAD_CPUTIME 79
  222. #define _SC_THREAD_DESTRUCTOR_ITERATIONS 80
  223. #define _SC_THREAD_KEYS_MAX 81
  224. #define _SC_THREAD_PRIO_INHERIT 82
  225. #define _SC_THREAD_PRIO_PROTECT 83
  226. #define _SC_THREAD_PRIORITY_SCHEDULING 84
  227. #define _SC_THREAD_PROCESS_SHARED 85
  228. #define _SC_THREAD_ROBUST_PRIO_INHERIT 86
  229. #define _SC_THREAD_ROBUST_PRIO_PROTECT 87
  230. #define _SC_THREAD_SPORADIC_SERVER 88
  231. #define _SC_THREAD_STACK_MIN 89
  232. #define _SC_THREAD_THREADS_MAX 90
  233. #define _SC_THREADS 91
  234. #define _SC_TIMEOUTS 92
  235. #define _SC_TIMER_MAX 93
  236. #define _SC_TIMERS 94
  237. #define _SC_TRACE 95
  238. #define _SC_TRACE_EVENT_FILTER 96
  239. #define _SC_TRACE_EVENT_NAME_MAX 97
  240. #define _SC_TRACE_INHERIT 98
  241. #define _SC_TRACE_LOG 99
  242. #define _SC_GETGR_R_SIZE_MAX 100
  243. #define _SC_GETPW_R_SIZE_MAX 101
  244. #define _SC_LOGIN_NAME_MAX 102
  245. #define _SC_THREAD_SAFE_FUNCTIONS 103
  246. #define _SC_TRACE_NAME_MAX 104
  247. #define _SC_TRACE_SYS_MAX 105
  248. #define _SC_TRACE_USER_EVENT_MAX 106
  249. #define _SC_TTY_NAME_MAX 107
  250. #define _SC_TYPED_MEMORY_OBJECTS 108
  251. #define _SC_V6_ILP32_OFF32 109
  252. #define _SC_V6_ILP32_OFFBIG 110
  253. #define _SC_V6_LP64_OFF64 111
  254. #define _SC_V6_LPBIG_OFFBIG 112
  255. #define _SC_V7_ILP32_OFF32 113
  256. #define _SC_V7_ILP32_OFFBIG 114
  257. #define _SC_V7_LP64_OFF64 115
  258. #define _SC_V7_LPBIG_OFFBIG 116
  259. #define _SC_XOPEN_CRYPT 117
  260. #define _SC_XOPEN_ENH_I18N 118
  261. #define _SC_XOPEN_LEGACY 119
  262. #define _SC_XOPEN_REALTIME 120
  263. #define _SC_XOPEN_REALTIME_THREADS 121
  264. #define _SC_XOPEN_STREAMS 122
  265. #define _SC_XOPEN_UNIX 123
  266. #define _SC_XOPEN_UUCP 124
  267. #define _SC_XOPEN_VERSION 125
  268. #define _SC_PHYS_PAGES 500
  269. #define _SC_AVPHYS_PAGES 501
  270. #define _SC_NPROCESSORS_CONF 502
  271. #define _SC_NPROCESSORS_ONLN 503
  272. /* configurable system strings */
  273. #define _CS_PATH 1
  274. #define _CS_POSIX_V6_ILP32_OFF32_CFLAGS 2
  275. #define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS 3
  276. #define _CS_POSIX_V6_ILP32_OFF32_LIBS 4
  277. #define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS 5
  278. #define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS 6
  279. #define _CS_POSIX_V6_ILP32_OFFBIG_LIBS 7
  280. #define _CS_POSIX_V6_LP64_OFF64_CFLAGS 8
  281. #define _CS_POSIX_V6_LP64_OFF64_LDFLAGS 9
  282. #define _CS_POSIX_V6_LP64_OFF64_LIBS 10
  283. #define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS 11
  284. #define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS 12
  285. #define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS 13
  286. #define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 14
  287. #define _CS_V6_ENV 15
  288. #define _CS_POSIX_V7_ILP32_OFF32_CFLAGS 16
  289. #define _CS_POSIX_V7_ILP32_OFF32_LDFLAGS 17
  290. #define _CS_POSIX_V7_ILP32_OFF32_LIBS 18
  291. #define _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS 19
  292. #define _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS 20
  293. #define _CS_POSIX_V7_ILP32_OFFBIG_LIBS 21
  294. #define _CS_POSIX_V7_LP64_OFF64_CFLAGS 22
  295. #define _CS_POSIX_V7_LP64_OFF64_LDFLAGS 23
  296. #define _CS_POSIX_V7_LP64_OFF64_LIBS 24
  297. #define _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS 25
  298. #define _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS 26
  299. #define _CS_POSIX_V7_LPBIG_OFFBIG_LIBS 27
  300. #define _CS_POSIX_V7_THREADS_CFLAGS 28
  301. #define _CS_POSIX_V7_THREADS_LDFLAGS 29
  302. #define _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS 30
  303. #define _CS_V7_ENV 31
  304. #ifndef NULL
  305. #ifdef __GNUG__
  306. #define NULL __null
  307. #elif defined(__cplusplus)
  308. #define NULL 0L
  309. #else
  310. #define NULL ((void *)0)
  311. #endif
  312. #endif
  313. #ifndef _INTPTR_T_DEFINED_
  314. #define _INTPTR_T_DEFINED_
  315. typedef __intptr_t intptr_t;
  316. #endif
  317. __BEGIN_DECLS
  318. __dead void _exit(int);
  319. int access(const char *, int);
  320. unsigned int alarm(unsigned int);
  321. int chdir(const char *);
  322. int chown(const char *, uid_t, gid_t);
  323. int close(int);
  324. int dup(int);
  325. int dup2(int, int);
  326. int execl(const char *, const char *, ...)
  327. __attribute__((__sentinel__));
  328. int execle(const char *, const char *, ...);
  329. int execlp(const char *, const char *, ...)
  330. __attribute__((__sentinel__));
  331. int execv(const char *, char *const *);
  332. int execve(const char *, char *const *, char *const *);
  333. int execvp(const char *, char *const *);
  334. #if __BSD_VISIBLE
  335. int execvpe(const char *, char *const *, char *const *);
  336. #endif
  337. pid_t fork(void);
  338. long fpathconf(int, int);
  339. char *getcwd(char *, size_t)
  340. __attribute__((__bounded__(__string__,1,2)));
  341. gid_t getegid(void);
  342. uid_t geteuid(void);
  343. gid_t getgid(void);
  344. int getgroups(int, gid_t *);
  345. char *getlogin(void);
  346. pid_t getpgrp(void);
  347. pid_t getpid(void);
  348. pid_t getppid(void);
  349. uid_t getuid(void);
  350. int isatty(int);
  351. int link(const char *, const char *);
  352. off_t lseek(int, off_t, int);
  353. long pathconf(const char *, int);
  354. int pause(void);
  355. int pipe(int *);
  356. ssize_t read(int, void *, size_t)
  357. __attribute__((__bounded__(__buffer__,2,3)));
  358. int rmdir(const char *);
  359. int setgid(gid_t);
  360. int setuid(uid_t);
  361. unsigned int sleep(unsigned int);
  362. long sysconf(int);
  363. pid_t tcgetpgrp(int);
  364. int tcsetpgrp(int, pid_t);
  365. char *ttyname(int);
  366. int unlink(const char *);
  367. ssize_t write(int, const void *, size_t)
  368. __attribute__((__bounded__(__buffer__,2,3)));
  369. #if __POSIX_VISIBLE || __XPG_VISIBLE >= 300
  370. pid_t setsid(void);
  371. int setpgid(pid_t, pid_t);
  372. #endif
  373. #if __POSIX_VISIBLE >= 199209 || __XPG_VISIBLE
  374. size_t confstr(int, char *, size_t)
  375. __attribute__((__bounded__(__string__,2,3)));
  376. #ifndef _GETOPT_DEFINED_
  377. #define _GETOPT_DEFINED_
  378. int getopt(int, char * const *, const char *);
  379. extern char *optarg; /* getopt(3) external variables */
  380. extern int opterr, optind, optopt, optreset;
  381. #endif /* _GETOPT_DEFINED_ */
  382. #endif
  383. #if __POSIX_VISIBLE >= 199506 || __XPG_VISIBLE
  384. int fsync(int);
  385. int ftruncate(int, off_t);
  386. int getlogin_r(char *, size_t)
  387. __attribute__((__bounded__(__string__,1,2)));
  388. ssize_t readlink(const char * __restrict, char * __restrict, size_t)
  389. __attribute__ ((__bounded__(__string__,2,3)));
  390. #endif
  391. #if __POSIX_VISIBLE >= 199506
  392. int fdatasync(int);
  393. #endif
  394. #if __XPG_VISIBLE || __BSD_VISIBLE
  395. char *crypt(const char *, const char *);
  396. int fchdir(int);
  397. int fchown(int, uid_t, gid_t);
  398. long gethostid(void);
  399. char *getwd(char *)
  400. __attribute__ ((__bounded__(__minbytes__,1,1024)));
  401. int lchown(const char *, uid_t, gid_t);
  402. int mkstemp(char *);
  403. char *mktemp(char *);
  404. int nice(int);
  405. int setregid(gid_t, gid_t);
  406. int setreuid(uid_t, uid_t);
  407. void swab(const void *__restrict, void *__restrict, ssize_t);
  408. void sync(void);
  409. int truncate(const char *, off_t);
  410. useconds_t ualarm(useconds_t, useconds_t);
  411. int usleep(useconds_t);
  412. pid_t vfork(void);
  413. #endif
  414. #if __POSIX_VISIBLE >= 200809 || __XPG_VISIBLE >= 420
  415. pid_t getpgid(pid_t);
  416. pid_t getsid(pid_t);
  417. #endif
  418. #if __XPG_VISIBLE >= 500
  419. ssize_t pread(int, void *, size_t, off_t)
  420. __attribute__((__bounded__(__buffer__,2,3)));
  421. ssize_t pwrite(int, const void *, size_t, off_t)
  422. __attribute__((__bounded__(__buffer__,2,3)));
  423. int ttyname_r(int, char *, size_t)
  424. __attribute__((__bounded__(__string__,2,3)));
  425. #endif
  426. #if __BSD_VISIBLE || __XPG_VISIBLE <= 500
  427. /* Interfaces withdrawn by X/Open Issue 5 Version 0 */
  428. int brk(void *);
  429. int chroot(const char *);
  430. int getdtablesize(void);
  431. int getpagesize(void);
  432. char *getpass(const char *);
  433. void *sbrk(int);
  434. #endif
  435. #if __POSIX_VISIBLE >= 200112 || __XPG_VISIBLE >= 420
  436. int lockf(int, int, off_t);
  437. #endif
  438. #if __POSIX_VISIBLE >= 200112 || __XPG_VISIBLE >= 420 || __BSD_VISIBLE
  439. int symlink(const char *, const char *);
  440. int gethostname(char *, size_t)
  441. __attribute__ ((__bounded__(__string__,1,2)));
  442. int setegid(gid_t);
  443. int seteuid(uid_t);
  444. #endif
  445. #if __POSIX_VISIBLE >= 200809
  446. int faccessat(int, const char *, int, int);
  447. int fchownat(int, const char *, uid_t, gid_t, int);
  448. int linkat(int, const char *, int, const char *, int);
  449. ssize_t readlinkat(int, const char *, char *, size_t)
  450. __attribute__ ((__bounded__(__string__,3,4)));
  451. int symlinkat(const char *, int, const char *);
  452. int unlinkat(int, const char *, int);
  453. #endif
  454. #if __BSD_VISIBLE
  455. int dup3(int, int, int);
  456. int pipe2(int [2], int);
  457. #endif
  458. #if __BSD_VISIBLE
  459. int acct(const char *);
  460. int closefrom(int);
  461. int crypt_checkpass(const char *, const char *);
  462. int crypt_newhash(const char *, const char *, char *, size_t);
  463. void endusershell(void);
  464. int exect(const char *, char * const *, char * const *);
  465. char *fflagstostr(u_int32_t);
  466. int getdomainname(char *, size_t)
  467. __attribute__ ((__bounded__(__string__,1,2)));
  468. int getdtablecount(void);
  469. int getgrouplist(const char *, gid_t, gid_t *, int *);
  470. mode_t getmode(const void *, mode_t);
  471. int getresgid(gid_t *, gid_t *, gid_t *);
  472. int getresuid(uid_t *, uid_t *, uid_t *);
  473. pid_t getthrid(void);
  474. char *getusershell(void);
  475. int initgroups(const char *, gid_t);
  476. int iruserok(u_int32_t, int, const char *, const char *);
  477. int iruserok_sa(const void *, int, int, const char *, const char *);
  478. int issetugid(void);
  479. char *mkdtemp(char *);
  480. int mkstemps(char *, int);
  481. int nfssvc(int, void *);
  482. int profil(char *, size_t, unsigned long, unsigned int)
  483. __attribute__ ((__bounded__(__string__,1,2)));
  484. int quotactl(const char *, int, int, char *);
  485. int rcmd(char **, int, const char *,
  486. const char *, const char *, int *);
  487. int rcmd_af(char **, int, const char *,
  488. const char *, const char *, int *, int);
  489. int rcmdsh(char **, int, const char *,
  490. const char *, const char *, char *);
  491. int reboot(int);
  492. int revoke(const char *);
  493. int rresvport(int *);
  494. int rresvport_af(int *, int);
  495. int ruserok(const char *, int, const char *, const char *);
  496. #ifndef _SELECT_DEFINED_
  497. #define _SELECT_DEFINED_
  498. struct timeval;
  499. int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
  500. #endif
  501. int setdomainname(const char *, size_t);
  502. int setgroups(int, const gid_t *);
  503. int sethostid(long);
  504. int sethostname(const char *, size_t);
  505. int setlogin(const char *);
  506. void *setmode(const char *);
  507. int setpgrp(pid_t _pid, pid_t _pgrp); /* BSD compat version */
  508. int setresgid(gid_t, gid_t, gid_t);
  509. int setresuid(uid_t, uid_t, uid_t);
  510. void setusershell(void);
  511. int strtofflags(char **, u_int32_t *, u_int32_t *);
  512. int swapctl(int cmd, const void *arg, int misc);
  513. int syscall(int, ...);
  514. int getentropy(void *, size_t);
  515. pid_t __tfork_thread(const struct __tfork *, size_t, void (*)(void *),
  516. void *);
  517. #endif /* __BSD_VISIBLE */
  518. __END_DECLS
  519. #endif /* !_UNISTD_H_ */