FreeBSD/Linux Kernel Cross Reference
sys/sys/unistd.h
1 /*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software
14 * must display the following acknowledgement:
15 * This product includes software developed by the University of
16 * California, Berkeley and its contributors.
17 * 4. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)unistd.h 8.2 (Berkeley) 1/7/94
34 * $FreeBSD$
35 */
36
37 #ifndef _SYS_UNISTD_H_
38 #define _SYS_UNISTD_H_
39
40 #include <sys/_posix.h>
41
42 /* compile-time symbolic constants */
43 #define _POSIX_JOB_CONTROL /* implementation supports job control */
44
45 /*
46 * Although we have saved user/group IDs, we do not use them in setuid
47 * as described in POSIX 1003.1, because the feature does not work for
48 * root. We use the saved IDs in seteuid/setegid, which are not currently
49 * part of the POSIX 1003.1 specification.
50 */
51 #ifdef _NOT_AVAILABLE
52 #define _POSIX_SAVED_IDS /* saved set-user-ID and set-group-ID */
53 #endif
54
55 #define _POSIX2_VERSION 199212L
56
57 /* execution-time symbolic constants */
58 /* chown requires appropriate privileges */
59 #define _POSIX_CHOWN_RESTRICTED 1
60 /* too-long path components generate errors */
61 #define _POSIX_NO_TRUNC 1
62 /* may disable terminal special characters */
63 #define _POSIX_VDISABLE 0xff
64
65 /* access function */
66 #define F_OK 0 /* test for existence of file */
67 #define X_OK 0x01 /* test for execute or search permission */
68 #define W_OK 0x02 /* test for write permission */
69 #define R_OK 0x04 /* test for read permission */
70
71 /* whence values for lseek(2) */
72 #define SEEK_SET 0 /* set file offset to offset */
73 #define SEEK_CUR 1 /* set file offset to current plus offset */
74 #define SEEK_END 2 /* set file offset to EOF plus offset */
75
76 #ifndef _POSIX_SOURCE
77 /* whence values for lseek(2); renamed by POSIX 1003.1 */
78 #define L_SET SEEK_SET
79 #define L_INCR SEEK_CUR
80 #define L_XTND SEEK_END
81 #endif
82
83 /* configurable pathname variables */
84 #define _PC_LINK_MAX 1
85 #define _PC_MAX_CANON 2
86 #define _PC_MAX_INPUT 3
87 #define _PC_NAME_MAX 4
88 #define _PC_PATH_MAX 5
89 #define _PC_PIPE_BUF 6
90 #define _PC_CHOWN_RESTRICTED 7
91 #define _PC_NO_TRUNC 8
92 #define _PC_VDISABLE 9
93
94 /* configurable system variables */
95 #define _SC_ARG_MAX 1
96 #define _SC_CHILD_MAX 2
97 #define _SC_CLK_TCK 3
98 #define _SC_NGROUPS_MAX 4
99 #define _SC_OPEN_MAX 5
100 #define _SC_JOB_CONTROL 6
101 #define _SC_SAVED_IDS 7
102 #define _SC_VERSION 8
103 #define _SC_BC_BASE_MAX 9
104 #define _SC_BC_DIM_MAX 10
105 #define _SC_BC_SCALE_MAX 11
106 #define _SC_BC_STRING_MAX 12
107 #define _SC_COLL_WEIGHTS_MAX 13
108 #define _SC_EXPR_NEST_MAX 14
109 #define _SC_LINE_MAX 15
110 #define _SC_RE_DUP_MAX 16
111 #define _SC_2_VERSION 17
112 #define _SC_2_C_BIND 18
113 #define _SC_2_C_DEV 19
114 #define _SC_2_CHAR_TERM 20
115 #define _SC_2_FORT_DEV 21
116 #define _SC_2_FORT_RUN 22
117 #define _SC_2_LOCALEDEF 23
118 #define _SC_2_SW_DEV 24
119 #define _SC_2_UPE 25
120 #define _SC_STREAM_MAX 26
121 #define _SC_TZNAME_MAX 27
122
123 /* configurable system strings */
124 #define _CS_PATH 1
125
126 #ifdef _P1003_1B_VISIBLE
127
128 #define _POSIX_PRIORITY_SCHEDULING
129
130 #if 0
131 /* Not until the dust settles after the header commit
132 */
133 #define _POSIX_ASYNCHRONOUS_IO
134 #define _POSIX_MEMLOCK
135 #define _POSIX_MEMLOCK_RANGE
136 #endif
137
138 /* POSIX.1B sysconf options */
139 #define _SC_ASYNCHRONOUS_IO 28
140 #define _SC_MAPPED_FILES 29
141 #define _SC_MEMLOCK 30
142 #define _SC_MEMLOCK_RANGE 31
143 #define _SC_MEMORY_PROTECTION 32
144 #define _SC_MESSAGE_PASSING 33
145 #define _SC_PRIORITIZED_IO 34
146 #define _SC_PRIORITY_SCHEDULING 35
147 #define _SC_REALTIME_SIGNALS 36
148 #define _SC_SEMAPHORES 37
149 #define _SC_FSYNC 38
150 #define _SC_SHARED_MEMORY_OBJECTS 39
151 #define _SC_SYNCHRONIZED_IO 40
152 #define _SC_TIMERS 41
153 #define _SC_AIO_LISTIO_MAX 42
154 #define _SC_AIO_MAX 43
155 #define _SC_AIO_PRIO_DELTA_MAX 44
156 #define _SC_DELAYTIMER_MAX 45
157 #define _SC_MQ_OPEN_MAX 46
158 #define _SC_PAGESIZE 47
159 #define _SC_RTSIG_MAX 48
160 #define _SC_SEM_NSEMS_MAX 49
161 #define _SC_SEM_VALUE_MAX 50
162 #define _SC_SIGQUEUE_MAX 51
163 #define _SC_TIMER_MAX 52
164
165 /* POSIX.1B pathconf and fpathconf options */
166 #define _PC_ASYNC_IO 53
167 #define _PC_PRIO_IO 54
168 #define _PC_SYNC_IO 55
169
170 #endif /* _P1003_1B_VISIBLE */
171
172 #ifndef _POSIX_SOURCE
173 /*
174 * rfork() options.
175 *
176 * XXX currently, operations without RFPROC set are not supported.
177 */
178 #define RFNAMEG (1<<0) /* UNIMPL new plan9 `name space' */
179 #define RFENVG (1<<1) /* UNIMPL copy plan9 `env space' */
180 #define RFFDG (1<<2) /* copy fd table */
181 #define RFNOTEG (1<<3) /* UNIMPL create new plan9 `note group' */
182 #define RFPROC (1<<4) /* change child (else changes curproc) */
183 #define RFMEM (1<<5) /* share `address space' */
184 #define RFNOWAIT (1<<6) /* parent need not wait() on child */
185 #define RFCNAMEG (1<<10) /* UNIMPL zero plan9 `name space' */
186 #define RFCENVG (1<<11) /* UNIMPL zero plan9 `env space' */
187 #define RFCFDG (1<<12) /* zero fd table */
188 #define RFTHREAD (1<<13) /* enable kernel thread support */
189 #define RFSIGSHARE (1<<14) /* share signal handlers */
190 #define RFLINUXTHPN (1<<16) /* do linux clone exit parent notification */
191 #define RFPPWAIT (1<<31) /* parent sleeps until child exits (vfork) */
192
193 #endif /* !_POSIX_SOURCE */
194
195 #endif /* !_SYS_UNISTD_H_ */
Cache object: a4894b045031eca2e859c36857b6964d
|