1 | /** @file
|
---|
2 | * FreeBSD 5.3
|
---|
3 | * @todo This needs more LIBC tuning!
|
---|
4 | * @changed bird: initial LIBC setup.
|
---|
5 | */
|
---|
6 | /*
|
---|
7 | * Copyright (c) 1989, 1993
|
---|
8 | * The Regents of the University of California. All rights reserved.
|
---|
9 | *
|
---|
10 | * Redistribution and use in source and binary forms, with or without
|
---|
11 | * modification, are permitted provided that the following conditions
|
---|
12 | * are met:
|
---|
13 | * 1. Redistributions of source code must retain the above copyright
|
---|
14 | * notice, this list of conditions and the following disclaimer.
|
---|
15 | * 2. Redistributions in binary form must reproduce the above copyright
|
---|
16 | * notice, this list of conditions and the following disclaimer in the
|
---|
17 | * documentation and/or other materials provided with the distribution.
|
---|
18 | * 4. Neither the name of the University nor the names of its contributors
|
---|
19 | * may be used to endorse or promote products derived from this software
|
---|
20 | * without specific prior written permission.
|
---|
21 | *
|
---|
22 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
---|
23 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
---|
24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
---|
25 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
---|
26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
---|
27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
---|
28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
---|
29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
---|
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
---|
31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
---|
32 | * SUCH DAMAGE.
|
---|
33 | *
|
---|
34 | * @(#)unistd.h 8.2 (Berkeley) 1/7/94
|
---|
35 | * $FreeBSD: src/sys/sys/unistd.h,v 1.40 2004/04/07 04:19:50 imp Exp $
|
---|
36 | */
|
---|
37 |
|
---|
38 | #ifndef _SYS_UNISTD_H_
|
---|
39 | #define _SYS_UNISTD_H_
|
---|
40 |
|
---|
41 | #include <sys/cdefs.h>
|
---|
42 |
|
---|
43 | /*
|
---|
44 | * POSIX options and option groups we unconditionally do or don't
|
---|
45 | * implement. Those options which are implemented (or not) entirely
|
---|
46 | * in user mode are defined in <unistd.h>. Please keep this list in
|
---|
47 | * alphabetical order.
|
---|
48 | *
|
---|
49 | * Anything which is defined as zero below **must** have an
|
---|
50 | * implementation for the corresponding sysconf() which is able to
|
---|
51 | * determine conclusively whether or not the feature is supported.
|
---|
52 | * Anything which is defined as other than -1 below **must** have
|
---|
53 | * complete headers, types, and function declarations as specified by
|
---|
54 | * the POSIX standard; however, if the relevant sysconf() function
|
---|
55 | * returns -1, the functions may be stubbed out.
|
---|
56 | */
|
---|
57 | #define _POSIX_ADVISORY_INFO -1
|
---|
58 | #define _POSIX_ASYNCHRONOUS_IO -1 /*bird: 0*/
|
---|
59 | #define _POSIX_CHOWN_RESTRICTED -1 /*bird: 1*/
|
---|
60 | #define _POSIX_CLOCK_SELECTION -1
|
---|
61 | #define _POSIX_CPUTIME -1
|
---|
62 | #define _POSIX_FSYNC 200112L
|
---|
63 | #define _POSIX_IPV6 0
|
---|
64 | #define _POSIX_JOB_CONTROL 1
|
---|
65 | #define _POSIX_MAPPED_FILES -1 /*bird: 200112L */
|
---|
66 | #define _POSIX_MEMLOCK -1
|
---|
67 | #define _POSIX_MEMLOCK_RANGE -1 /*bird: 200112L */
|
---|
68 | #define _POSIX_MEMORY_PROTECTION 200112L
|
---|
69 | #define _POSIX_MESSAGE_PASSING -1
|
---|
70 | #define _POSIX_MONOTONIC_CLOCK -1
|
---|
71 | #define _POSIX_NO_TRUNC 1
|
---|
72 | #define _POSIX_PRIORITIZED_IO -1
|
---|
73 | #define _POSIX_PRIORITY_SCHEDULING -1 /*bird: 200112L*/
|
---|
74 | #define _POSIX_RAW_SOCKETS -1 /*bird: 200112L*/
|
---|
75 | #define _POSIX_REALTIME_SIGNALS -1
|
---|
76 | #define _POSIX_SEMAPHORES -1
|
---|
77 | #define _POSIX_SHARED_MEMORY_OBJECTS -1 /*bird: 200112L*/
|
---|
78 | #define _POSIX_SPORADIC_SERVER -1
|
---|
79 | #define _POSIX_SYNCHRONIZED_IO -1
|
---|
80 | #define _POSIX_TIMEOUTS -1
|
---|
81 | #define _POSIX_TYPED_MEMORY_OBJECTS -1
|
---|
82 | #define _POSIX_VDISABLE 0xff
|
---|
83 |
|
---|
84 | #if __XSI_VISIBLE
|
---|
85 | #define _XOPEN_SHM -1 /*bird: 1 */
|
---|
86 | #define _XOPEN_STREAMS -1
|
---|
87 | #endif
|
---|
88 |
|
---|
89 | /*
|
---|
90 | * Although we have saved user/group IDs, we do not use them in setuid
|
---|
91 | * as described in POSIX 1003.1, because the feature does not work for
|
---|
92 | * root. We use the saved IDs in seteuid/setegid, which are not currently
|
---|
93 | * part of the POSIX 1003.1 specification. XXX revisit for 1003.1-2001
|
---|
94 | * as this is now mandatory.
|
---|
95 | */
|
---|
96 | #ifdef _NOT_AVAILABLE
|
---|
97 | #define _POSIX_SAVED_IDS 1 /* saved set-user-ID and set-group-ID */
|
---|
98 | #endif
|
---|
99 |
|
---|
100 | /* Define the POSIX.1 version we target for compliance. */
|
---|
101 | #define _POSIX_VERSION 200112L
|
---|
102 |
|
---|
103 | /* access function */
|
---|
104 | #define F_OK 0 /* test for existence of file */
|
---|
105 | #define X_OK 0x01 /* test for execute or search permission */
|
---|
106 | #define W_OK 0x02 /* test for write permission */
|
---|
107 | #define R_OK 0x04 /* test for read permission */
|
---|
108 |
|
---|
109 | /* whence values for lseek(2) */
|
---|
110 | #ifndef SEEK_SET
|
---|
111 | #define SEEK_SET 0 /* set file offset to offset */
|
---|
112 | #define SEEK_CUR 1 /* set file offset to current plus offset */
|
---|
113 | #define SEEK_END 2 /* set file offset to EOF plus offset */
|
---|
114 | #endif
|
---|
115 |
|
---|
116 | #ifndef _POSIX_SOURCE
|
---|
117 | /* whence values for lseek(2); renamed by POSIX 1003.1 */
|
---|
118 | #define L_SET SEEK_SET
|
---|
119 | #define L_INCR SEEK_CUR
|
---|
120 | #define L_XTND SEEK_END
|
---|
121 | #endif
|
---|
122 |
|
---|
123 | /* configurable pathname variables */
|
---|
124 | #define _PC_LINK_MAX 1
|
---|
125 | #define _PC_MAX_CANON 2
|
---|
126 | #define _PC_MAX_INPUT 3
|
---|
127 | #define _PC_NAME_MAX 4
|
---|
128 | #define _PC_PATH_MAX 5
|
---|
129 | #define _PC_PIPE_BUF 6
|
---|
130 | #define _PC_CHOWN_RESTRICTED 7
|
---|
131 | #define _PC_NO_TRUNC 8
|
---|
132 | #define _PC_VDISABLE 9
|
---|
133 |
|
---|
134 | #if __POSIX_VISIBLE >= 199309
|
---|
135 | #define _PC_ASYNC_IO 53
|
---|
136 | #define _PC_PRIO_IO 54
|
---|
137 | #define _PC_SYNC_IO 55
|
---|
138 | #endif
|
---|
139 |
|
---|
140 | #if __POSIX_VISIBLE >= 200112
|
---|
141 | #define _PC_ALLOC_SIZE_MIN 10
|
---|
142 | #define _PC_FILESIZEBITS 12
|
---|
143 | #define _PC_REC_INCR_XFER_SIZE 14
|
---|
144 | #define _PC_REC_MAX_XFER_SIZE 15
|
---|
145 | #define _PC_REC_MIN_XFER_SIZE 16
|
---|
146 | #define _PC_REC_XFER_ALIGN 17
|
---|
147 | #define _PC_SYMLINK_MAX 18
|
---|
148 | #endif
|
---|
149 |
|
---|
150 | #if __BSD_VISIBLE
|
---|
151 | #define _PC_ACL_EXTENDED 59
|
---|
152 | #define _PC_ACL_PATH_MAX 60
|
---|
153 | #define _PC_CAP_PRESENT 61
|
---|
154 | #define _PC_INF_PRESENT 62
|
---|
155 | #define _PC_MAC_PRESENT 63
|
---|
156 | #endif
|
---|
157 |
|
---|
158 | #if 0 /* bird */
|
---|
159 | #if __BSD_VISIBLE
|
---|
160 | /*
|
---|
161 | * rfork() options.
|
---|
162 | *
|
---|
163 | * XXX currently, some operations without RFPROC set are not supported.
|
---|
164 | */
|
---|
165 | #define RFNAMEG (1<<0) /* UNIMPL new plan9 `name space' */
|
---|
166 | #define RFENVG (1<<1) /* UNIMPL copy plan9 `env space' */
|
---|
167 | #define RFFDG (1<<2) /* copy fd table */
|
---|
168 | #define RFNOTEG (1<<3) /* UNIMPL create new plan9 `note group' */
|
---|
169 | #define RFPROC (1<<4) /* change child (else changes curproc) */
|
---|
170 | #define RFMEM (1<<5) /* share `address space' */
|
---|
171 | #define RFNOWAIT (1<<6) /* give child to init */
|
---|
172 | #define RFCNAMEG (1<<10) /* UNIMPL zero plan9 `name space' */
|
---|
173 | #define RFCENVG (1<<11) /* UNIMPL zero plan9 `env space' */
|
---|
174 | #define RFCFDG (1<<12) /* close all fds, zero fd table */
|
---|
175 | #define RFTHREAD (1<<13) /* enable kernel thread support */
|
---|
176 | #define RFSIGSHARE (1<<14) /* share signal handlers */
|
---|
177 | #define RFLINUXTHPN (1<<16) /* do linux clone exit parent notification */
|
---|
178 | #define RFSTOPPED (1<<17) /* leave child in a stopped state */
|
---|
179 | #define RFHIGHPID (1<<18) /* use a pid higher then 10 (idleproc) */
|
---|
180 | #define RFPPWAIT (1<<31) /* parent sleeps until child exits (vfork) */
|
---|
181 | #define RFKERNELONLY (RFSTOPPED | RFHIGHPID | RFPPWAIT)
|
---|
182 |
|
---|
183 | #endif /* __BSD_VISIBLE */
|
---|
184 | #endif /* bird */
|
---|
185 |
|
---|
186 | #endif /* !_SYS_UNISTD_H_ */
|
---|