1 | /* $Id: */
|
---|
2 | /** @file
|
---|
3 | * FreeBSD 5.3
|
---|
4 | *
|
---|
5 | * @changed Commented out stuff which isn't implemented, TCPIP stuff at bottom.
|
---|
6 | * @changed setkey returns void not int in the standard and our implementation (glibc).
|
---|
7 | * @todo Several man-years.. ;) Serious, complete the FreeBSD 5.3 merge and
|
---|
8 | * implement all the functions. Currently there is a bunch of POSIX
|
---|
9 | * #defines missing.
|
---|
10 | */
|
---|
11 |
|
---|
12 | /*-
|
---|
13 | * Copyright (c) 1991, 1993, 1994
|
---|
14 | * The Regents of the University of California. All rights reserved.
|
---|
15 | *
|
---|
16 | * Redistribution and use in source and binary forms, with or without
|
---|
17 | * modification, are permitted provided that the following conditions
|
---|
18 | * are met:
|
---|
19 | * 1. Redistributions of source code must retain the above copyright
|
---|
20 | * notice, this list of conditions and the following disclaimer.
|
---|
21 | * 2. Redistributions in binary form must reproduce the above copyright
|
---|
22 | * notice, this list of conditions and the following disclaimer in the
|
---|
23 | * documentation and/or other materials provided with the distribution.
|
---|
24 | * 3. All advertising materials mentioning features or use of this software
|
---|
25 | * must display the following acknowledgement:
|
---|
26 | * This product includes software developed by the University of
|
---|
27 | * California, Berkeley and its contributors.
|
---|
28 | * 4. Neither the name of the University nor the names of its contributors
|
---|
29 | * may be used to endorse or promote products derived from this software
|
---|
30 | * without specific prior written permission.
|
---|
31 | *
|
---|
32 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
---|
33 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
---|
34 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
---|
35 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
---|
36 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
---|
37 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
---|
38 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
---|
39 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
---|
40 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
---|
41 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
---|
42 | * SUCH DAMAGE.
|
---|
43 | *
|
---|
44 | * @(#)unistd.h 8.12 (Berkeley) 4/27/95
|
---|
45 | * $FreeBSD: src/include/unistd.h,v 1.73 2004/02/23 04:51:07 ache Exp $
|
---|
46 | */
|
---|
47 |
|
---|
48 | #ifndef _UNISTD_H_
|
---|
49 | #define _UNISTD_H_
|
---|
50 | #define _UNISTD_H /* bird: emx */
|
---|
51 |
|
---|
52 | #include <sys/cdefs.h>
|
---|
53 | #include <sys/types.h> /* XXX adds too much pollution. */
|
---|
54 | #include <sys/unistd.h>
|
---|
55 | #include <sys/_null.h>
|
---|
56 | #include <sys/_types.h>
|
---|
57 |
|
---|
58 | #if !defined(_GID_T_DECLARED) && !defined(_GID_T) /* bird: emx */
|
---|
59 | typedef __gid_t gid_t; /* group id */
|
---|
60 | #define _GID_T_DECLARED
|
---|
61 | #define _GID_T /* bird: emx */
|
---|
62 | #endif
|
---|
63 |
|
---|
64 | #if !defined(_OFF_T_DECLARED) && !defined(_OFF_T) /* bird:emx */
|
---|
65 | typedef __off_t off_t; /* file offset */
|
---|
66 | #define _OFF_T_DECLARED
|
---|
67 | #define _OFF_T /* bird: emx */
|
---|
68 | #endif
|
---|
69 |
|
---|
70 | #if !defined(_PID_T_DECLARED) && !defined(_PID_T) /* bird:emx */
|
---|
71 | typedef __pid_t pid_t; /* process id */
|
---|
72 | #define _PID_T_DECLARED
|
---|
73 | #define _PID_T /* bird: emx */
|
---|
74 | #endif
|
---|
75 |
|
---|
76 | #if !defined(_SIZE_T_DECLARED) && !defined(_SIZE_T) /* bird: emx */
|
---|
77 | typedef __size_t size_t;
|
---|
78 | #define _SIZE_T_DECLARED
|
---|
79 | #define _SIZE_T /* bird: emx */
|
---|
80 | #endif
|
---|
81 |
|
---|
82 | #if !defined(_SSIZE_T_DECLARED) && !defined(_SSIZE_T) /* bird: emx */
|
---|
83 | typedef __ssize_t ssize_t;
|
---|
84 | #define _SSIZE_T_DECLARED
|
---|
85 | #define _SSIZE_T /* bird: emx */
|
---|
86 | #endif
|
---|
87 |
|
---|
88 | #if !defined(_UID_T_DECLARED) && !defined(_UID_T) /* bird: emx */
|
---|
89 | typedef __uid_t uid_t; /* user id */
|
---|
90 | #define _UID_T_DECLARED
|
---|
91 | #define _UID_T /* bird: emx */
|
---|
92 | #endif
|
---|
93 |
|
---|
94 | #ifndef _USECONDS_T_DECLARED
|
---|
95 | typedef __useconds_t useconds_t; /* microseconds (unsigned) */
|
---|
96 | #define _USECONDS_T_DECLARED
|
---|
97 | #endif
|
---|
98 |
|
---|
99 | #define STDIN_FILENO 0 /* standard input file descriptor */
|
---|
100 | #define STDOUT_FILENO 1 /* standard output file descriptor */
|
---|
101 | #define STDERR_FILENO 2 /* standard error file descriptor */
|
---|
102 |
|
---|
103 | #if __XSI_VISIBLE || __POSIX_VISIBLE >= 200112
|
---|
104 | #define F_ULOCK 0 /* unlock locked section */
|
---|
105 | #define F_LOCK 1 /* lock a section for exclusive use */
|
---|
106 | #define F_TLOCK 2 /* test and lock a section for exclusive use */
|
---|
107 | #define F_TEST 3 /* test a section for locks by other procs */
|
---|
108 | #endif
|
---|
109 |
|
---|
110 | /*
|
---|
111 | * POSIX options and option groups we unconditionally do or don't
|
---|
112 | * implement. This list includes those options which are exclusively
|
---|
113 | * implemented (or not) in user mode. Please keep this list in
|
---|
114 | * alphabetical order.
|
---|
115 | *
|
---|
116 | * Anything which is defined as zero below **must** have an
|
---|
117 | * implementation for the corresponding sysconf() which is able to
|
---|
118 | * determine conclusively whether or not the feature is supported.
|
---|
119 | * Anything which is defined as other than -1 below **must** have
|
---|
120 | * complete headers, types, and function declarations as specified by
|
---|
121 | * the POSIX standard; however, if the relevant sysconf() function
|
---|
122 | * returns -1, the functions may be stubbed out.
|
---|
123 | */
|
---|
124 | #define _POSIX_BARRIERS -1
|
---|
125 | #define _POSIX_READER_WRITER_LOCKS 200112L
|
---|
126 | #define _POSIX_REGEXP 1
|
---|
127 | #define _POSIX_SHELL 1
|
---|
128 | #define _POSIX_SPAWN -1
|
---|
129 | #define _POSIX_SPIN_LOCKS -1
|
---|
130 | #define _POSIX_THREAD_ATTR_STACKADDR -1 /*bird: 200112L */
|
---|
131 | #define _POSIX_THREAD_ATTR_STACKSIZE -1 /*bird: 200112L */
|
---|
132 | #define _POSIX_THREAD_CPUTIME -1
|
---|
133 | #define _POSIX_THREAD_PRIO_INHERIT 200112L
|
---|
134 | #define _POSIX_THREAD_PRIO_PROTECT -1 /*bird: 200112L */
|
---|
135 | #define _POSIX_THREAD_PRIORITY_SCHEDULING -1 /*bird: 200112L */
|
---|
136 | #define _POSIX_THREAD_PROCESS_SHARED -1
|
---|
137 | #define _POSIX_THREAD_SAFE_FUNCTIONS -1
|
---|
138 | #define _POSIX_THREAD_SPORADIC_SERVER -1
|
---|
139 | #define _POSIX_THREADS -1 /*bird: 200112L */
|
---|
140 | #define _POSIX_TRACE -1
|
---|
141 | #define _POSIX_TRACE_EVENT_FILTER -1
|
---|
142 | #define _POSIX_TRACE_INHERIT -1
|
---|
143 | #define _POSIX_TRACE_LOG -1
|
---|
144 | #define _POSIX2_C_BIND 200112L /* mandatory */
|
---|
145 | #define _POSIX2_C_DEV -1 /* need c99 utility */
|
---|
146 | #define _POSIX2_CHAR_TERM 1
|
---|
147 | #define _POSIX2_FORT_DEV -1 /* need fort77 utility */
|
---|
148 | #define _POSIX2_FORT_RUN -1 /*bird: 200112L */
|
---|
149 | #define _POSIX2_LOCALEDEF -1
|
---|
150 | #define _POSIX2_PBS -1
|
---|
151 | #define _POSIX2_PBS_ACCOUNTING -1
|
---|
152 | #define _POSIX2_PBS_CHECKPOINT -1
|
---|
153 | #define _POSIX2_PBS_LOCATE -1
|
---|
154 | #define _POSIX2_PBS_MESSAGE -1
|
---|
155 | #define _POSIX2_PBS_TRACK -1
|
---|
156 | #define _POSIX2_SW_DEV -1 /* XXX ??? */
|
---|
157 | #define _POSIX2_UPE 200112L
|
---|
158 | #define _V6_ILP32_OFF32 -1
|
---|
159 | #define _V6_ILP32_OFFBIG 0
|
---|
160 | #define _V6_LP64_OFF64 0
|
---|
161 | #define _V6_LPBIG_OFFBIG -1
|
---|
162 |
|
---|
163 | #if __XSI_VISIBLE
|
---|
164 | #define _XOPEN_CRYPT -1 /* XXX ??? */
|
---|
165 | #define _XOPEN_ENH_I18N -1 /* mandatory in XSI */
|
---|
166 | #define _XOPEN_LEGACY -1
|
---|
167 | #define _XOPEN_REALTIME -1
|
---|
168 | #define _XOPEN_REALTIME_THREADS -1
|
---|
169 | #define _XOPEN_UNIX -1
|
---|
170 | #endif
|
---|
171 |
|
---|
172 | /* Define the POSIX.2 version we target for compliance. */
|
---|
173 | #define _POSIX2_VERSION 199212L
|
---|
174 |
|
---|
175 | /*
|
---|
176 | * POSIX-style system configuration variable accessors (for the
|
---|
177 | * sysconf function). The kernel does not directly implement the
|
---|
178 | * sysconf() interface; rather, a C library stub translates references
|
---|
179 | * to sysconf() into calls to sysctl() using a giant switch statement.
|
---|
180 | * Those that are marked `user' are implemented entirely in the C
|
---|
181 | * library and never query the kernel. pathconf() is implemented
|
---|
182 | * directly by the kernel so those are not defined here.
|
---|
183 | */
|
---|
184 | #define _SC_ARG_MAX 1
|
---|
185 | #define _SC_CHILD_MAX 2
|
---|
186 | #define _SC_CLK_TCK 3
|
---|
187 | #define _SC_NGROUPS_MAX 4
|
---|
188 | #define _SC_OPEN_MAX 5
|
---|
189 | #define _SC_JOB_CONTROL 6
|
---|
190 | #define _SC_SAVED_IDS 7
|
---|
191 | #define _SC_VERSION 8
|
---|
192 | #define _SC_BC_BASE_MAX 9 /* user */
|
---|
193 | #define _SC_BC_DIM_MAX 10 /* user */
|
---|
194 | #define _SC_BC_SCALE_MAX 11 /* user */
|
---|
195 | #define _SC_BC_STRING_MAX 12 /* user */
|
---|
196 | #define _SC_COLL_WEIGHTS_MAX 13 /* user */
|
---|
197 | #define _SC_EXPR_NEST_MAX 14 /* user */
|
---|
198 | #define _SC_LINE_MAX 15 /* user */
|
---|
199 | #define _SC_RE_DUP_MAX 16 /* user */
|
---|
200 | #define _SC_2_VERSION 17 /* user */
|
---|
201 | #define _SC_2_C_BIND 18 /* user */
|
---|
202 | #define _SC_2_C_DEV 19 /* user */
|
---|
203 | #define _SC_2_CHAR_TERM 20 /* user */
|
---|
204 | #define _SC_2_FORT_DEV 21 /* user */
|
---|
205 | #define _SC_2_FORT_RUN 22 /* user */
|
---|
206 | #define _SC_2_LOCALEDEF 23 /* user */
|
---|
207 | #define _SC_2_SW_DEV 24 /* user */
|
---|
208 | #define _SC_2_UPE 25 /* user */
|
---|
209 | #define _SC_STREAM_MAX 26 /* user */
|
---|
210 | #define _SC_TZNAME_MAX 27 /* user */
|
---|
211 |
|
---|
212 | #if __POSIX_VISIBLE >= 199309
|
---|
213 | #define _SC_ASYNCHRONOUS_IO 28
|
---|
214 | #define _SC_MAPPED_FILES 29
|
---|
215 | #define _SC_MEMLOCK 30
|
---|
216 | #define _SC_MEMLOCK_RANGE 31
|
---|
217 | #define _SC_MEMORY_PROTECTION 32
|
---|
218 | #define _SC_MESSAGE_PASSING 33
|
---|
219 | #define _SC_PRIORITIZED_IO 34
|
---|
220 | #define _SC_PRIORITY_SCHEDULING 35
|
---|
221 | #define _SC_REALTIME_SIGNALS 36
|
---|
222 | #define _SC_SEMAPHORES 37
|
---|
223 | #define _SC_FSYNC 38
|
---|
224 | #define _SC_SHARED_MEMORY_OBJECTS 39
|
---|
225 | #define _SC_SYNCHRONIZED_IO 40
|
---|
226 | #define _SC_TIMERS 41
|
---|
227 | #define _SC_AIO_LISTIO_MAX 42
|
---|
228 | #define _SC_AIO_MAX 43
|
---|
229 | #define _SC_AIO_PRIO_DELTA_MAX 44
|
---|
230 | #define _SC_DELAYTIMER_MAX 45
|
---|
231 | #define _SC_MQ_OPEN_MAX 46
|
---|
232 | #define _SC_PAGESIZE 47
|
---|
233 | #define _SC_RTSIG_MAX 48
|
---|
234 | #define _SC_SEM_NSEMS_MAX 49
|
---|
235 | #define _SC_SEM_VALUE_MAX 50
|
---|
236 | #define _SC_SIGQUEUE_MAX 51
|
---|
237 | #define _SC_TIMER_MAX 52
|
---|
238 | #endif
|
---|
239 |
|
---|
240 | #if __POSIX_VISIBLE >= 200112
|
---|
241 | #define _SC_2_PBS 59 /* user */
|
---|
242 | #define _SC_2_PBS_ACCOUNTING 60 /* user */
|
---|
243 | #define _SC_2_PBS_CHECKPOINT 61 /* user */
|
---|
244 | #define _SC_2_PBS_LOCATE 62 /* user */
|
---|
245 | #define _SC_2_PBS_MESSAGE 63 /* user */
|
---|
246 | #define _SC_2_PBS_TRACK 64 /* user */
|
---|
247 | #define _SC_ADVISORY_INFO 65
|
---|
248 | #define _SC_BARRIERS 66 /* user */
|
---|
249 | #define _SC_CLOCK_SELECTION 67
|
---|
250 | #define _SC_CPUTIME 68
|
---|
251 | #define _SC_FILE_LOCKING 69
|
---|
252 | #define _SC_GETGR_R_SIZE_MAX 70 /* user */
|
---|
253 | #define _SC_GETPW_R_SIZE_MAX 71 /* user */
|
---|
254 | #define _SC_HOST_NAME_MAX 72
|
---|
255 | #define _SC_LOGIN_NAME_MAX 73
|
---|
256 | #define _SC_MONOTONIC_CLOCK 74
|
---|
257 | #define _SC_MQ_PRIO_MAX 75
|
---|
258 | #define _SC_READER_WRITER_LOCKS 76 /* user */
|
---|
259 | #define _SC_REGEXP 77 /* user */
|
---|
260 | #define _SC_SHELL 78 /* user */
|
---|
261 | #define _SC_SPAWN 79 /* user */
|
---|
262 | #define _SC_SPIN_LOCKS 80 /* user */
|
---|
263 | #define _SC_SPORADIC_SERVER 81
|
---|
264 | #define _SC_THREAD_ATTR_STACKADDR 82 /* user */
|
---|
265 | #define _SC_THREAD_ATTR_STACKSIZE 83 /* user */
|
---|
266 | #define _SC_THREAD_CPUTIME 84 /* user */
|
---|
267 | #define _SC_THREAD_DESTRUCTOR_ITERATIONS 85 /* user */
|
---|
268 | #define _SC_THREAD_KEYS_MAX 86 /* user */
|
---|
269 | #define _SC_THREAD_PRIO_INHERIT 87 /* user */
|
---|
270 | #define _SC_THREAD_PRIO_PROTECT 88 /* user */
|
---|
271 | #define _SC_THREAD_PRIORITY_SCHEDULING 89 /* user */
|
---|
272 | #define _SC_THREAD_PROCESS_SHARED 90 /* user */
|
---|
273 | #define _SC_THREAD_SAFE_FUNCTIONS 91 /* user */
|
---|
274 | #define _SC_THREAD_SPORADIC_SERVER 92 /* user */
|
---|
275 | #define _SC_THREAD_STACK_MIN 93 /* user */
|
---|
276 | #define _SC_THREAD_THREADS_MAX 94 /* user */
|
---|
277 | #define _SC_TIMEOUTS 95 /* user */
|
---|
278 | #define _SC_THREADS 96 /* user */
|
---|
279 | #define _SC_TRACE 97 /* user */
|
---|
280 | #define _SC_TRACE_EVENT_FILTER 98 /* user */
|
---|
281 | #define _SC_TRACE_INHERIT 99 /* user */
|
---|
282 | #define _SC_TRACE_LOG 100 /* user */
|
---|
283 | #define _SC_TTY_NAME_MAX 101 /* user */
|
---|
284 | #define _SC_TYPED_MEMORY_OBJECTS 102
|
---|
285 | #define _SC_V6_ILP32_OFF32 103 /* user */
|
---|
286 | #define _SC_V6_ILP32_OFFBIG 104 /* user */
|
---|
287 | #define _SC_V6_LP64_OFF64 105 /* user */
|
---|
288 | #define _SC_V6_LPBIG_OFFBIG 106 /* user */
|
---|
289 | #define _SC_IPV6 118
|
---|
290 | #define _SC_RAW_SOCKETS 119
|
---|
291 | #define _SC_SYMLOOP_MAX 120
|
---|
292 | #endif
|
---|
293 |
|
---|
294 | #if __XSI_VISIBLE
|
---|
295 | #define _SC_ATEXIT_MAX 107 /* user */
|
---|
296 | #define _SC_IOV_MAX 56
|
---|
297 | #define _SC_PAGE_SIZE _SC_PAGESIZE
|
---|
298 | #define _SC_XOPEN_CRYPT 108 /* user */
|
---|
299 | #define _SC_XOPEN_ENH_I18N 109 /* user */
|
---|
300 | #define _SC_XOPEN_LEGACY 110 /* user */
|
---|
301 | #define _SC_XOPEN_REALTIME 111
|
---|
302 | #define _SC_XOPEN_REALTIME_THREADS 112
|
---|
303 | #define _SC_XOPEN_SHM 113
|
---|
304 | #define _SC_XOPEN_STREAMS 114
|
---|
305 | #define _SC_XOPEN_UNIX 115
|
---|
306 | #define _SC_XOPEN_VERSION 116
|
---|
307 | #define _SC_XOPEN_XCU_VERSION 117 /* user */
|
---|
308 | #endif
|
---|
309 |
|
---|
310 | #if __BSD_VISIBLE
|
---|
311 | #define _SC_NPROCESSORS_CONF 57
|
---|
312 | #define _SC_NPROCESSORS_ONLN 58
|
---|
313 | #endif
|
---|
314 |
|
---|
315 | /* Keys for the confstr(3) function. */
|
---|
316 | #if __POSIX_VISIBLE >= 199209
|
---|
317 | #define _CS_PATH 1 /* default value of PATH */
|
---|
318 | #endif
|
---|
319 |
|
---|
320 | #if __POSIX_VISIBLE >= 200112
|
---|
321 | #define _CS_POSIX_V6_ILP32_OFF32_CFLAGS 2
|
---|
322 | #define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS 3
|
---|
323 | #define _CS_POSIX_V6_ILP32_OFF32_LIBS 4
|
---|
324 | #define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS 5
|
---|
325 | #define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS 6
|
---|
326 | #define _CS_POSIX_V6_ILP32_OFFBIG_LIBS 7
|
---|
327 | #define _CS_POSIX_V6_LP64_OFF64_CFLAGS 8
|
---|
328 | #define _CS_POSIX_V6_LP64_OFF64_LDFLAGS 9
|
---|
329 | #define _CS_POSIX_V6_LP64_OFF64_LIBS 10
|
---|
330 | #define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS 11
|
---|
331 | #define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS 12
|
---|
332 | #define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS 13
|
---|
333 | #define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 14
|
---|
334 | #endif
|
---|
335 |
|
---|
336 | __BEGIN_DECLS
|
---|
337 | /* 1003.1-1990 */
|
---|
338 | void _exit(int) __dead2;
|
---|
339 | int access(const char *, int);
|
---|
340 | unsigned int alarm(unsigned int);
|
---|
341 | int chdir(const char *);
|
---|
342 | int chown(const char *, uid_t, gid_t);
|
---|
343 | int close(int);
|
---|
344 | int dup(int);
|
---|
345 | int dup2(int, int);
|
---|
346 | int eaccess(const char *, int);
|
---|
347 | int execl(const char *, const char *, ...);
|
---|
348 | int execle(const char *, const char *, ...);
|
---|
349 | int execlp(const char *, const char *, ...);
|
---|
350 | int execv(const char *, char * const *);
|
---|
351 | int execve(const char *, char * const *, char * const *);
|
---|
352 | int execvp(const char *, char * const *);
|
---|
353 | pid_t fork(void);
|
---|
354 | long fpathconf(int, int);
|
---|
355 | char *getcwd(char *, size_t);
|
---|
356 | gid_t getegid(void);
|
---|
357 | uid_t geteuid(void);
|
---|
358 | gid_t getgid(void);
|
---|
359 | int getgroups(int, gid_t []);
|
---|
360 | char *getlogin(void);
|
---|
361 | pid_t getpgrp(void);
|
---|
362 | pid_t getpid(void);
|
---|
363 | pid_t getppid(void);
|
---|
364 | uid_t getuid(void);
|
---|
365 | int isatty(int);
|
---|
366 | int link(const char *, const char *);
|
---|
367 | #ifndef _LSEEK_DECLARED
|
---|
368 | #define _LSEEK_DECLARED
|
---|
369 | off_t lseek(int, off_t, int);
|
---|
370 | #endif
|
---|
371 | long pathconf(const char *, int);
|
---|
372 | int pause(void);
|
---|
373 | int pipe(int *);
|
---|
374 | ssize_t read(int, void *, size_t);
|
---|
375 | int rmdir(const char *);
|
---|
376 | int setgid(gid_t);
|
---|
377 | int setpgid(pid_t, pid_t);
|
---|
378 | void setproctitle(const char *_fmt, ...) __printf0like(1, 2);
|
---|
379 | pid_t setsid(void);
|
---|
380 | int setuid(uid_t);
|
---|
381 | unsigned int sleep(unsigned int);
|
---|
382 | long sysconf(int);
|
---|
383 | pid_t tcgetpgrp(int);
|
---|
384 | int tcsetpgrp(int, pid_t);
|
---|
385 | char *ttyname(int);
|
---|
386 | int unlink(const char *);
|
---|
387 | ssize_t write(int, const void *, size_t);
|
---|
388 |
|
---|
389 | /* 1003.2-1992 */
|
---|
390 | #if __POSIX_VISIBLE >= 199209 || __XSI_VISIBLE
|
---|
391 | /** @todo size_t confstr(int, char *, size_t);*/
|
---|
392 | #ifndef _GETOPT_DECLARED
|
---|
393 | #define _GETOPT_DECLARED
|
---|
394 | int getopt(int, char * const [], const char *);
|
---|
395 |
|
---|
396 | extern char *optarg; /* getopt(3) external variables */
|
---|
397 | extern int optind, opterr, optopt;
|
---|
398 | #endif /* _GETOPT_DECLARED */
|
---|
399 | #endif
|
---|
400 |
|
---|
401 | /* ISO/IEC 9945-1: 1996 */
|
---|
402 | #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE
|
---|
403 | int fsync(int);
|
---|
404 |
|
---|
405 | /*
|
---|
406 | * ftruncate() was in the POSIX Realtime Extension (it's used for shared
|
---|
407 | * memory), but truncate() was not.
|
---|
408 | */
|
---|
409 | #ifndef _FTRUNCATE_DECLARED
|
---|
410 | #define _FTRUNCATE_DECLARED
|
---|
411 | int ftruncate(int, off_t);
|
---|
412 | #endif
|
---|
413 | #endif
|
---|
414 |
|
---|
415 | #if __POSIX_VISIBLE >= 199506
|
---|
416 | int getlogin_r(char *, int);
|
---|
417 | #endif
|
---|
418 |
|
---|
419 | /* 1003.1-2001 */
|
---|
420 | #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
|
---|
421 | int fchown(int, uid_t, gid_t);
|
---|
422 | int readlink(const char *, char *, int);
|
---|
423 | #endif
|
---|
424 | #if __POSIX_VISIBLE >= 200112
|
---|
425 | /* tcpip: int gethostname(char *, size_t); */
|
---|
426 | int setegid(gid_t);
|
---|
427 | int seteuid(uid_t);
|
---|
428 | #endif
|
---|
429 |
|
---|
430 | /*
|
---|
431 | * symlink() was originally in POSIX.1a, which was withdrawn after
|
---|
432 | * being overtaken by events (1003.1-2001). It was in XPG4.2, and of
|
---|
433 | * course has been in BSD since 4.2.
|
---|
434 | */
|
---|
435 | #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 402 || __BSD_VISIBLE
|
---|
436 | int symlink(const char * __restrict, const char * __restrict);
|
---|
437 | #endif
|
---|
438 |
|
---|
439 | /* X/Open System Interfaces */
|
---|
440 | #if __XSI_VISIBLE
|
---|
441 | char *crypt(const char *, const char *);
|
---|
442 | /** @todo char *ctermid(char *); */ /* XXX ??? */
|
---|
443 | void encrypt(char *, int); /* bird: SuS say it returns void, and so does our implementation */
|
---|
444 | int fchdir(int);
|
---|
445 | /* tcpip: long gethostid(void); */
|
---|
446 | pid_t getpgid(pid_t _pid); /* bird: SuS say pid_r return. */
|
---|
447 | pid_t getsid(pid_t _pid); /* bird: SuS say pid_r return? */
|
---|
448 | char *getwd(char *); /* LEGACY: obsoleted by getcwd() */
|
---|
449 | int lchown(const char *, uid_t, gid_t);
|
---|
450 | int lockf(int, int, off_t);
|
---|
451 | int nice(int);
|
---|
452 | ssize_t pread(int, void *, size_t, off_t);
|
---|
453 | ssize_t pwrite(int, const void *, size_t, off_t);
|
---|
454 | /** @todo int setpgrp(pid_t _pid, pid_t _pgrp); */ /* obsoleted by setpgid() */
|
---|
455 | int setregid(gid_t, gid_t);
|
---|
456 | int setreuid(uid_t, uid_t);
|
---|
457 |
|
---|
458 | #ifndef _SWAB_DECLARED /* bird: also in string.h */
|
---|
459 | # define _SWAB_DECLARED /* bird: also in string.h */
|
---|
460 | void swab(const void * __restrict, void * __restrict, ssize_t);
|
---|
461 | #endif /* !_SWAB_DECLARED */ /* bird: also in string.h */
|
---|
462 | void sync(void);
|
---|
463 | useconds_t ualarm(useconds_t, useconds_t);
|
---|
464 | int usleep(useconds_t);
|
---|
465 | /** @todo pid_t vfork(void); */
|
---|
466 |
|
---|
467 | /* See comment at ftruncate() above. */
|
---|
468 | #ifndef _TRUNCATE_DECLARED
|
---|
469 | #define _TRUNCATE_DECLARED
|
---|
470 | int truncate(const char *, off_t);
|
---|
471 | #endif
|
---|
472 | #endif /* __XSI_VISIBLE */
|
---|
473 |
|
---|
474 | #if __XSI_VISIBLE <= 500 || __BSD_VISIBLE
|
---|
475 | int brk(const void *);
|
---|
476 | int chroot(const char *);
|
---|
477 | int getdtablesize(void);
|
---|
478 | int getpagesize(void) __pure2;
|
---|
479 | char *getpass(const char *);
|
---|
480 | void *sbrk(intptr_t);
|
---|
481 | #endif
|
---|
482 |
|
---|
483 | #if __BSD_VISIBLE
|
---|
484 | struct timeval; /* select(2) */
|
---|
485 | /** @todo int acct(const char *); */
|
---|
486 | /** @todo int async_daemon(void); */
|
---|
487 | /** @todo int check_utility_compat(const char *); */
|
---|
488 | /** @todo const char *
|
---|
489 | crypt_get_format(void); */
|
---|
490 | /** @todo int crypt_set_format(const char *); */
|
---|
491 | /** @todo int des_cipher(const char *, char *, long, int); */
|
---|
492 | /** @todo int des_setkey(const char *key); */
|
---|
493 | void endusershell(void);
|
---|
494 | /** @todo int exect(const char *, char * const *, char * const *); */
|
---|
495 | /** @todo int execvP(const char *, const char *, char * const *); */
|
---|
496 | /** @todo char *fflagstostr(u_long); */
|
---|
497 | /** @todo int getdomainname(char *, int); */
|
---|
498 | int getgrouplist(const char *, gid_t, gid_t *, int *);
|
---|
499 | mode_t getmode(const void *, mode_t);
|
---|
500 | /** @todo int getpeereid(int, uid_t *, gid_t *); */
|
---|
501 | /** @todo int getresgid(gid_t *, gid_t *, gid_t *); */
|
---|
502 | /** @todo int getresuid(uid_t *, uid_t *, uid_t *); */
|
---|
503 | char *getusershell(void);
|
---|
504 | int initgroups(const char *, gid_t);
|
---|
505 | /** @todo int iruserok(unsigned long, int, const char *, const char *); */
|
---|
506 | /** @todo int iruserok_sa(const void *, int, int, const char *, const char *); */
|
---|
507 | int issetugid(void);
|
---|
508 | char *mkdtemp(char *);
|
---|
509 | int mknod(const char *, mode_t, dev_t);
|
---|
510 | #ifndef _MKSTEMP_DECLARED
|
---|
511 | int mkstemp(char *);
|
---|
512 | #define _MKSTEMP_DECLARED
|
---|
513 | #endif
|
---|
514 | int mkstemps(char *, int);
|
---|
515 | #ifndef _MKTEMP_DECLARED
|
---|
516 | char *mktemp(char *);
|
---|
517 | #define _MKTEMP_DECLARED
|
---|
518 | #endif
|
---|
519 | /** @todo int nfsclnt(int, void *); */
|
---|
520 | /** @todo int nfssvc(int, void *); */
|
---|
521 | /** @todo int profil(char *, size_t, vm_offset_t, int); */
|
---|
522 | /** @todo int rcmd(char **, int, const char *, const char *, const char *, int *); */
|
---|
523 | /** @todo int rcmd_af(char **, int, const char *,
|
---|
524 | const char *, const char *, int *, int); */
|
---|
525 | /** @todo int rcmdsh(char **, int, const char *,
|
---|
526 | const char *, const char *, const char *); */
|
---|
527 | char *re_comp(const char *);
|
---|
528 | int re_exec(const char *);
|
---|
529 | /** @todo int reboot(int); */
|
---|
530 | /** @todo int revoke(const char *); */
|
---|
531 | /** @todo pid_t rfork(int); */
|
---|
532 | /** @todo pid_t rfork_thread(int, void *, int (*)(void *), void *); */
|
---|
533 | /** @todo int rresvport(int *); */
|
---|
534 | /** @todo int rresvport_af(int *, int); */
|
---|
535 | /** @todo int ruserok(const char *, int, const char *, const char *); */
|
---|
536 | #if __BSD_VISIBLE
|
---|
537 | #ifndef _SELECT_DECLARED
|
---|
538 | #define _SELECT_DECLARED
|
---|
539 | int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
|
---|
540 | #endif
|
---|
541 | #endif
|
---|
542 | /** @todo int setdomainname(const char *, int); */
|
---|
543 | int setgroups(int, const gid_t *);
|
---|
544 | /** @todo void sethostid(long); */
|
---|
545 | /** @todo int sethostname(const char *, int); */
|
---|
546 | #ifndef _SETKEY_DECLARED
|
---|
547 | /*int setkey(const char *); bird: SUS say void return and so does glibc! */
|
---|
548 | void setkey(const char *);
|
---|
549 | #define _SETKEY_DECLARED
|
---|
550 | #endif
|
---|
551 | /** @todo int setlogin(const char *); */
|
---|
552 | void *bsd_setmode(const char *);
|
---|
553 | int setresgid(gid_t, gid_t, gid_t);
|
---|
554 | int setresuid(uid_t, uid_t, uid_t);
|
---|
555 | int setrgid(gid_t);
|
---|
556 | int setruid(uid_t);
|
---|
557 | void setusershell(void);
|
---|
558 | /** @todo int strtofflags(char **, u_long *, u_long *); */
|
---|
559 | /** @todo int swapon(const char *); */
|
---|
560 | /** @todo int swapoff(const char *); */
|
---|
561 | /** @todo int syscall(int, ...); */
|
---|
562 | /** @todo off_t __syscall(quad_t, ...); */
|
---|
563 | /** @todo int ttyslot(void); */
|
---|
564 | /** @todo int undelete(const char *); */
|
---|
565 | /** @todo int unwhiteout(const char *); */
|
---|
566 | void *valloc(size_t); /* obsoleted by malloc() */
|
---|
567 |
|
---|
568 | #ifndef _OPTRESET_DECLARED
|
---|
569 | #define _OPTRESET_DECLARED
|
---|
570 | extern int optreset; /* getopt(3) external variable */
|
---|
571 | #endif
|
---|
572 | #endif /* __BSD_VISIBLE */
|
---|
573 |
|
---|
574 |
|
---|
575 | /*
|
---|
576 | * LIBC additions.
|
---|
577 | */
|
---|
578 | #ifdef __BSD_VISIBLE
|
---|
579 | char *_getcwdux(char *, size_t);
|
---|
580 | #endif
|
---|
581 | #ifdef __USE_GNU
|
---|
582 | char *get_current_dir_name(void);
|
---|
583 | #endif
|
---|
584 |
|
---|
585 |
|
---|
586 | /*
|
---|
587 | * EMX stuff.
|
---|
588 | */
|
---|
589 | #if __XSI_VISIBLE <= 500 || __BSD_VISIBLE
|
---|
590 | char *_getpass1(const char *);
|
---|
591 | char *_getpass2(const char *, int);
|
---|
592 | #endif
|
---|
593 |
|
---|
594 | #if !defined(_POSIX_SOURCE) || defined(_WITH_UNDERSCORE)
|
---|
595 | /** @todo update this section to match the one without underscores as far as needed! */
|
---|
596 | void __exit(int) __dead2;
|
---|
597 | int _access(const char *, int);
|
---|
598 | unsigned int _alarm(unsigned int);
|
---|
599 | int _chdir(const char *);
|
---|
600 | int _chown(const char *, uid_t, gid_t);
|
---|
601 | int _close(int);
|
---|
602 | char *_cuserid(char *);
|
---|
603 | int _dup(int);
|
---|
604 | int _dup2(int, int);
|
---|
605 | int _eaccess(const char *, int);
|
---|
606 | int _execl(const char *, const char *, ...);
|
---|
607 | int _execle(const char *, const char *, ...);
|
---|
608 | int _execlp(const char *, const char *, ...);
|
---|
609 | int _execv(const char *, char * const *);
|
---|
610 | int _execve(const char *, char * const *, char * const *);
|
---|
611 | int _execvp(const char *, char * const *);
|
---|
612 | pid_t _fork(void);
|
---|
613 | long _fpathconf(int, int);
|
---|
614 | char *_getcwd(char *, size_t);
|
---|
615 | gid_t _getegid(void);
|
---|
616 | uid_t _geteuid(void);
|
---|
617 | gid_t _getgid(void);
|
---|
618 | int _getgroups(int, gid_t []);
|
---|
619 | char *_getlogin(void);
|
---|
620 | pid_t _getpgrp(void);
|
---|
621 | pid_t _getpid(void);
|
---|
622 | pid_t _getppid(void);
|
---|
623 | uid_t _getuid(void);
|
---|
624 | int _isatty(int);
|
---|
625 | int _link(const char *, const char *);
|
---|
626 | #ifndef __LSEEK_DECLARED
|
---|
627 | #define __LSEEK_DECLARED
|
---|
628 | off_t _lseek(int, off_t, int);
|
---|
629 | #endif
|
---|
630 | long _pathconf(const char *, int);
|
---|
631 | int _pause(void);
|
---|
632 | int _pipe(int *);
|
---|
633 | ssize_t _read(int, void *, size_t);
|
---|
634 | int _rmdir(const char *);
|
---|
635 | int _setgid(gid_t);
|
---|
636 | /** @todo void _setproctitle(const char *_fmt, ...) __printf0like(1, 2); */
|
---|
637 | int _setpgid(pid_t, pid_t);
|
---|
638 | pid_t _setsid(void);
|
---|
639 | int _setuid(uid_t);
|
---|
640 | unsigned _sleep(unsigned);
|
---|
641 | long _sysconf(int);
|
---|
642 | pid_t _tcgetpgrp(int);
|
---|
643 | pid_t _tcsetpgrp(int, int);
|
---|
644 | char *_ttyname(int);
|
---|
645 | int _unlink(const char *);
|
---|
646 | int _write(int, const void *, size_t);
|
---|
647 |
|
---|
648 | int _brk(const void *);
|
---|
649 | char *_getpass(const char *);
|
---|
650 | char *_getpass1(const char *);
|
---|
651 | char *_getpass2(const char *, int);
|
---|
652 | int _mkstemp(char *);
|
---|
653 | char *_mktemp(char *);
|
---|
654 | void *_sbrk(intptr_t);
|
---|
655 | /** @todo int _profil(void *, unsigned, unsigned, unsigned); */
|
---|
656 |
|
---|
657 | /* 1003.2-1992 */
|
---|
658 | extern char *_optarg;
|
---|
659 | extern int _optind;
|
---|
660 | extern int _opterr;
|
---|
661 | extern int _optopt;
|
---|
662 | int _getopt(int, char **, const char *);
|
---|
663 |
|
---|
664 | #endif
|
---|
665 |
|
---|
666 | /* Toolkit compatibility */
|
---|
667 | #include <sys/cdefs.h>
|
---|
668 | #include <sys/types.h>
|
---|
669 | int TCPCALL soclose(int);
|
---|
670 | #ifndef _POSIX_SOURCE
|
---|
671 | int TCPCALL gethostid(void);
|
---|
672 | int TCPCALL gethostname(char *, int);
|
---|
673 | #ifndef TCPV40HDRS
|
---|
674 | int TCPCALL iruserok(unsigned long, int, const char *, const char *);
|
---|
675 | int TCPCALL rcmd(char **, int, const char *, const char *, const char *, int *);
|
---|
676 | int TCPCALL rresvport(int *);
|
---|
677 | int TCPCALL ruserok(const char *, int, const char *, const char *);
|
---|
678 | #include <sys/select.h>
|
---|
679 | #endif /* !TCP40HDRS */
|
---|
680 | #endif /* !_POSIX_SOURCE */
|
---|
681 |
|
---|
682 | #ifdef __USE_GNU
|
---|
683 |
|
---|
684 | /** Execute expr and restart it when interrupted. */
|
---|
685 | #define TEMP_FAILURE_RETRY(expr) \
|
---|
686 | (__extension__({ long __rc; do { __rc = (long)(expr); } while (__rc == -1L && errno == EINTR); __rc; }))
|
---|
687 |
|
---|
688 | #endif
|
---|
689 |
|
---|
690 | __END_DECLS
|
---|
691 |
|
---|
692 | #endif /* !_UNISTD_H_ */
|
---|