FreeBSD/Linux Kernel Cross Reference
sys/sys/unistd.h
1 /* $NetBSD: unistd.h,v 1.47 2008/08/27 08:58:16 christos Exp $ */
2
3 /*
4 * Copyright (c) 1989, 1993
5 * The Regents of the University of California. 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 8.2 (Berkeley) 1/7/94
32 */
33
34 #ifndef _SYS_UNISTD_H_
35 #define _SYS_UNISTD_H_
36
37 #include <sys/featuretest.h>
38
39 /* compile-time symbolic constants */
40 #define _POSIX_JOB_CONTROL 1
41 /* implementation supports job control */
42
43 /*
44 * According to POSIX 1003.1:
45 * "The saved set-user-ID capability allows a program to regain the
46 * effective user ID established at the last exec call."
47 * However, the setuid/setgid function as specified by POSIX 1003.1 does
48 * not allow changing the effective ID from the super-user without also
49 * changed the saved ID, so it is impossible to get super-user privileges
50 * back later. Instead we provide this feature independent of the current
51 * effective ID through the seteuid/setegid function. In addition, we do
52 * not use the saved ID as specified by POSIX 1003.1 in setuid/setgid,
53 * because this would make it impossible for a set-user-ID executable
54 * owned by a user other than the super-user to permanently revoke its
55 * extra privileges.
56 */
57 #ifdef _NOT_AVAILABLE
58 #define _POSIX_SAVED_IDS 1
59 /* saved set-user-ID and set-group-ID */
60 #endif
61
62 #define _POSIX_VERSION 199009L
63 #define _POSIX2_VERSION 199212L
64
65 /* execution-time symbolic constants */
66 /* asynchronous I/O is available */
67 #define _POSIX_ASYNCHRONOUS_IO 200112L
68 /* chown requires appropriate privileges */
69 #define _POSIX_CHOWN_RESTRICTED 1
70 /* clock selection */
71 #define _POSIX_CLOCK_SELECTION -1
72 /* too-long path components generate errors */
73 #define _POSIX_NO_TRUNC 1
74 /* may disable terminal special characters */
75 #define _POSIX_VDISABLE ((unsigned char)'\377')
76 /* file synchronization is available */
77 #define _POSIX_FSYNC 1
78 /* synchronized I/O is available */
79 #define _POSIX_SYNCHRONIZED_IO 1
80 /* memory mapped files */
81 #define _POSIX_MAPPED_FILES 1
82 /* memory locking of whole address space */
83 #define _POSIX_MEMLOCK 1
84 /* memory locking address ranges */
85 #define _POSIX_MEMLOCK_RANGE 1
86 /* memory access protections */
87 #define _POSIX_MEMORY_PROTECTION 1
88 /* message passing is available */
89 #define _POSIX_MESSAGE_PASSING 200112L
90 /* monotonic clock */
91 #define _POSIX_MONOTONIC_CLOCK 200112L
92 /* priority scheduling */
93 #define _POSIX_PRIORITY_SCHEDULING 200112L
94 /* threads */
95 #define _POSIX_THREADS 200112L
96 /* _r functions */
97 #define _POSIX_THREAD_SAFE_FUNCTIONS 200112L
98 /* pthread_attr functions for stack size */
99 #define _POSIX_THREAD_ATTR_STACKSIZE 200112L
100 /* pthread_attr functions for stack address */
101 #define _POSIX_THREAD_ATTR_STACKADDR 200112L
102 /* semaphores */
103 #define _POSIX_SEMAPHORES 0
104 /* barriers */
105 #define _POSIX_BARRIERS 200112L
106 /* timers */
107 #define _POSIX_TIMERS 200112L
108 /* spin locks */
109 #define _POSIX_SPIN_LOCKS 200112L
110 /* read/write locks */
111 #define _POSIX_READER_WRITER_LOCKS 200112L
112 /* XPG4.2 shared memory */
113 #define _XOPEN_SHM 0
114 /* shell */
115 #define _POSIX_SHELL 1
116 /* regular expressions */
117 #define _POSIX_REGEXP 1
118 /* C binding */
119 #define _POSIX2_C_BIND 200112L
120
121 /* access function */
122 #define F_OK 0 /* test for existence of file */
123 #define X_OK 0x01 /* test for execute or search permission */
124 #define W_OK 0x02 /* test for write permission */
125 #define R_OK 0x04 /* test for read permission */
126
127 /* whence values for lseek(2) */
128 #define SEEK_SET 0 /* set file offset to offset */
129 #define SEEK_CUR 1 /* set file offset to current plus offset */
130 #define SEEK_END 2 /* set file offset to EOF plus offset */
131
132 #if defined(_NETBSD_SOURCE)
133 /* whence values for lseek(2); renamed by POSIX 1003.1 */
134 #define L_SET SEEK_SET
135 #define L_INCR SEEK_CUR
136 #define L_XTND SEEK_END
137
138 /*
139 * fsync_range values.
140 *
141 * Note the following flag values were chosen to not overlap
142 * values for SEEK_XXX flags. While not currently implemented,
143 * it is possible to extend this call to respect SEEK_CUR and
144 * SEEK_END offset addressing modes.
145 */
146 #define FDATASYNC 0x0010 /* sync data and minimal metadata */
147 #define FFILESYNC 0x0020 /* sync data and metadata */
148 #define FDISKSYNC 0x0040 /* flush disk caches after sync */
149 #endif
150
151 /* configurable pathname variables; use as argument to pathconf(3) */
152 #define _PC_LINK_MAX 1
153 #define _PC_MAX_CANON 2
154 #define _PC_MAX_INPUT 3
155 #define _PC_NAME_MAX 4
156 #define _PC_PATH_MAX 5
157 #define _PC_PIPE_BUF 6
158 #define _PC_CHOWN_RESTRICTED 7
159 #define _PC_NO_TRUNC 8
160 #define _PC_VDISABLE 9
161 #define _PC_SYNC_IO 10
162 #define _PC_FILESIZEBITS 11
163 #define _PC_SYMLINK_MAX 12
164 #define _PC_2_SYMLINKS 13
165
166 /* configurable system variables; use as argument to sysconf(3) */
167 /*
168 * XXX The value of _SC_CLK_TCK is embedded in <time.h>.
169 * XXX The value of _SC_PAGESIZE is embedded in <sys/shm.h>.
170 */
171 #define _SC_ARG_MAX 1
172 #define _SC_CHILD_MAX 2
173 #define _O_SC_CLK_TCK 3 /* Old version, always 100 */
174 #define _SC_NGROUPS_MAX 4
175 #define _SC_OPEN_MAX 5
176 #define _SC_JOB_CONTROL 6
177 #define _SC_SAVED_IDS 7
178 #define _SC_VERSION 8
179 #define _SC_BC_BASE_MAX 9
180 #define _SC_BC_DIM_MAX 10
181 #define _SC_BC_SCALE_MAX 11
182 #define _SC_BC_STRING_MAX 12
183 #define _SC_COLL_WEIGHTS_MAX 13
184 #define _SC_EXPR_NEST_MAX 14
185 #define _SC_LINE_MAX 15
186 #define _SC_RE_DUP_MAX 16
187 #define _SC_2_VERSION 17
188 #define _SC_2_C_BIND 18
189 #define _SC_2_C_DEV 19
190 #define _SC_2_CHAR_TERM 20
191 #define _SC_2_FORT_DEV 21
192 #define _SC_2_FORT_RUN 22
193 #define _SC_2_LOCALEDEF 23
194 #define _SC_2_SW_DEV 24
195 #define _SC_2_UPE 25
196 #define _SC_STREAM_MAX 26
197 #define _SC_TZNAME_MAX 27
198 #define _SC_PAGESIZE 28
199 #define _SC_PAGE_SIZE _SC_PAGESIZE /* 1170 compatibility */
200 #define _SC_FSYNC 29
201 #define _SC_XOPEN_SHM 30
202 #define _SC_SYNCHRONIZED_IO 31
203 #define _SC_IOV_MAX 32
204 #define _SC_MAPPED_FILES 33
205 #define _SC_MEMLOCK 34
206 #define _SC_MEMLOCK_RANGE 35
207 #define _SC_MEMORY_PROTECTION 36
208 #define _SC_LOGIN_NAME_MAX 37
209 #define _SC_MONOTONIC_CLOCK 38
210 #define _SC_CLK_TCK 39 /* New, variable version */
211 #define _SC_ATEXIT_MAX 40
212 #define _SC_THREADS 41
213 #define _SC_SEMAPHORES 42
214 #define _SC_BARRIERS 43
215 #define _SC_TIMERS 44
216 #define _SC_SPIN_LOCKS 45
217 #define _SC_READER_WRITER_LOCKS 46
218 #define _SC_GETGR_R_SIZE_MAX 47
219 #define _SC_GETPW_R_SIZE_MAX 48
220 #define _SC_CLOCK_SELECTION 49
221 #define _SC_ASYNCHRONOUS_IO 50
222 #define _SC_AIO_LISTIO_MAX 51
223 #define _SC_AIO_MAX 52
224 #define _SC_MESSAGE_PASSING 53
225 #define _SC_MQ_OPEN_MAX 54
226 #define _SC_MQ_PRIO_MAX 55
227 #define _SC_PRIORITY_SCHEDULING 56
228 #define _SC_THREAD_DESTRUCTOR_ITERATIONS 57
229 #define _SC_THREAD_KEYS_MAX 58
230 #define _SC_THREAD_STACK_MIN 59
231 #define _SC_THREAD_THREADS_MAX 60
232 #define _SC_THREAD_ATTR_STACKADDR 61
233 #define _SC_THREAD_ATTR_STACKSIZE 62
234 #define _SC_THREAD_PRIORITY_SCHEDULING 63
235 #define _SC_THREAD_PRIO_INHERIT 64
236 #define _SC_THREAD_PRIO_PROTECT 65
237 #define _SC_THREAD_PROCESS_SHARED 66
238 #define _SC_THREAD_SAFE_FUNCTIONS 67
239 #define _SC_TTY_NAME_MAX 68
240 #define _SC_HOST_NAME_MAX 69
241 #define _SC_PASS_MAX 70
242 #define _SC_REGEXP 71
243 #define _SC_SHELL 72
244 #define _SC_SYMLOOP_MAX 73
245
246 /* Actually, they are not supported or implemented yet */
247 #define _SC_V6_ILP32_OFF32 74
248 #define _SC_V6_ILP32_OFFBIG 75
249 #define _SC_V6_LP64_OFF64 76
250 #define _SC_V6_LPBIG_OFFBIG 77
251 #define _SC_2_PBS 80
252 #define _SC_2_PBS_ACCOUNTING 81
253 #define _SC_2_PBS_CHECKPOINT 82
254 #define _SC_2_PBS_LOCATE 83
255 #define _SC_2_PBS_MESSAGE 84
256 #define _SC_2_PBS_TRACK 85
257
258 #ifdef _NETBSD_SOURCE
259 /* Commonly provided sysconf() extensions */
260 #define _SC_NPROCESSORS_CONF 1001
261 #define _SC_NPROCESSORS_ONLN 1002
262 /* Native variables */
263 #define _SC_SCHED_RT_TS 2001
264 #define _SC_SCHED_PRI_MIN 2002
265 #define _SC_SCHED_PRI_MAX 2003
266 #endif /* _NETBSD_SOURCE */
267
268 /* configurable system strings */
269 #define _CS_PATH 1
270
271 #endif /* !_SYS_UNISTD_H_ */
Cache object: 0321610101f76ec9506b4d7c5ea07dd0
|