]>
Commit | Line | Data |
---|---|---|
53e1e5c6 | 1 | /* $NetBSD: unistd.h,v 1.35 2006/08/14 18:17:48 rpaulo Exp $ */\r |
2 | \r | |
3 | /*\r | |
4 | * Copyright (c) 1989, 1993\r | |
5 | * The Regents of the University of California. All rights reserved.\r | |
6 | *\r | |
7 | * Redistribution and use in source and binary forms, with or without\r | |
8 | * modification, are permitted provided that the following conditions\r | |
9 | * are met:\r | |
10 | * 1. Redistributions of source code must retain the above copyright\r | |
11 | * notice, this list of conditions and the following disclaimer.\r | |
12 | * 2. Redistributions in binary form must reproduce the above copyright\r | |
13 | * notice, this list of conditions and the following disclaimer in the\r | |
14 | * documentation and/or other materials provided with the distribution.\r | |
15 | * 3. Neither the name of the University nor the names of its contributors\r | |
16 | * may be used to endorse or promote products derived from this software\r | |
17 | * without specific prior written permission.\r | |
18 | *\r | |
19 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\r | |
20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r | |
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r | |
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\r | |
23 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r | |
24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r | |
25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r | |
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r | |
27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r | |
28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r | |
29 | * SUCH DAMAGE.\r | |
30 | *\r | |
31 | * @(#)unistd.h 8.2 (Berkeley) 1/7/94\r | |
32 | */\r | |
33 | \r | |
34 | #ifndef _SYS_UNISTD_H_\r | |
35 | #define _SYS_UNISTD_H_\r | |
36 | \r | |
37 | #include <sys/featuretest.h>\r | |
38 | \r | |
39 | /* compile-time symbolic constants */\r | |
d7ce7006 | 40 | //#define _POSIX_JOB_CONTROL /* implementation supports job control */\r |
53e1e5c6 | 41 | \r |
42 | /*\r | |
43 | * According to POSIX 1003.1:\r | |
44 | * "The saved set-user-ID capability allows a program to regain the\r | |
45 | * effective user ID established at the last exec call."\r | |
46 | * However, the setuid/setgid function as specified by POSIX 1003.1 does\r | |
47 | * not allow changing the effective ID from the super-user without also\r | |
48 | * changed the saved ID, so it is impossible to get super-user privileges\r | |
49 | * back later. Instead we provide this feature independent of the current\r | |
50 | * effective ID through the seteuid/setegid function. In addition, we do\r | |
51 | * not use the saved ID as specified by POSIX 1003.1 in setuid/setgid,\r | |
52 | * because this would make it impossible for a set-user-ID executable\r | |
53 | * owned by a user other than the super-user to permanently revoke its\r | |
54 | * extra privileges.\r | |
55 | */\r | |
56 | #ifdef _NOT_AVAILABLE\r | |
57 | #define _POSIX_SAVED_IDS /* saved set-user-ID and set-group-ID */\r | |
58 | #endif\r | |
59 | \r | |
60 | #define _POSIX_VERSION 199009L\r | |
61 | #define _POSIX2_VERSION 199212L\r | |
62 | \r | |
63 | /* execution-time symbolic constants */\r | |
64 | /* chown requires appropriate privileges */\r | |
d7ce7006 | 65 | //#define _POSIX_CHOWN_RESTRICTED 1\r |
66 | // /* clock selection */\r | |
67 | //#define _POSIX_CLOCK_SELECTION -1\r | |
68 | // /* too-long path components generate errors */\r | |
69 | //#define _POSIX_NO_TRUNC 1\r | |
70 | // /* may disable terminal special characters */\r | |
71 | //#define _POSIX_VDISABLE ((unsigned char)'\377')\r | |
72 | // /* file synchronization is available */\r | |
73 | //#define _POSIX_FSYNC 1\r | |
74 | // /* synchronized I/O is available */\r | |
75 | //#define _POSIX_SYNCHRONIZED_IO 1\r | |
76 | // /* memory mapped files */\r | |
77 | //#define _POSIX_MAPPED_FILES 1\r | |
78 | // /* memory locking of whole address space */\r | |
79 | //#define _POSIX_MEMLOCK 1\r | |
80 | // /* memory locking address ranges */\r | |
81 | //#define _POSIX_MEMLOCK_RANGE 1\r | |
82 | // /* memory access protections */\r | |
83 | //#define _POSIX_MEMORY_PROTECTION 1\r | |
84 | // /* monotonic clock */\r | |
85 | //#define _POSIX_MONOTONIC_CLOCK 200112L\r | |
86 | // /* threads */\r | |
87 | //#define _POSIX_THREADS 200112L\r | |
88 | // /* semaphores */\r | |
89 | //#define _POSIX_SEMAPHORES 0\r | |
90 | // /* barriers */\r | |
91 | //#define _POSIX_BARRIERS 200112L\r | |
53e1e5c6 | 92 | /* timers */\r |
93 | #define _POSIX_TIMERS 200112L\r | |
94 | /* spin locks */\r | |
d7ce7006 | 95 | //#define _POSIX_SPIN_LOCKS 200112L\r |
96 | // /* read/write locks */\r | |
97 | //#define _POSIX_READER_WRITER_LOCKS 200112L\r | |
98 | // /* XPG4.2 shared memory */\r | |
99 | //#define _XOPEN_SHM 0\r | |
53e1e5c6 | 100 | \r |
53e1e5c6 | 101 | /* whence values for lseek(2); renamed by POSIX 1003.1 */\r |
102 | #define L_SET SEEK_SET\r | |
103 | #define L_INCR SEEK_CUR\r | |
104 | #define L_XTND SEEK_END\r | |
105 | \r | |
106 | /*\r | |
107 | * fsync_range values.\r | |
108 | *\r | |
109 | * Note the following flag values were chosen to not overlap\r | |
110 | * values for SEEK_XXX flags. While not currently implemented,\r | |
111 | * it is possible to extend this call to respect SEEK_CUR and\r | |
112 | * SEEK_END offset addressing modes.\r | |
113 | */\r | |
114 | #define FDATASYNC 0x0010 /* sync data and minimal metadata */\r | |
115 | #define FFILESYNC 0x0020 /* sync data and metadata */\r | |
116 | #define FDISKSYNC 0x0040 /* flush disk caches after sync */\r | |
53e1e5c6 | 117 | \r |
118 | /* configurable pathname variables; use as argument to pathconf(3) */\r | |
119 | #define _PC_LINK_MAX 1\r | |
120 | #define _PC_MAX_CANON 2\r | |
121 | #define _PC_MAX_INPUT 3\r | |
122 | #define _PC_NAME_MAX 4\r | |
123 | #define _PC_PATH_MAX 5\r | |
124 | #define _PC_PIPE_BUF 6\r | |
125 | #define _PC_CHOWN_RESTRICTED 7\r | |
126 | #define _PC_NO_TRUNC 8\r | |
127 | #define _PC_VDISABLE 9\r | |
128 | #define _PC_SYNC_IO 10\r | |
129 | #define _PC_FILESIZEBITS 11\r | |
130 | \r | |
131 | /* configurable system variables; use as argument to sysconf(3) */\r | |
132 | /*\r | |
133 | * XXX The value of _SC_CLK_TCK is embedded in <time.h>.\r | |
134 | * XXX The value of _SC_PAGESIZE is embedded in <sys/shm.h>.\r | |
135 | */\r | |
136 | #define _SC_ARG_MAX 1\r | |
137 | #define _SC_CHILD_MAX 2\r | |
138 | #define _O_SC_CLK_TCK 3 /* Old version, always 100 */\r | |
139 | #define _SC_NGROUPS_MAX 4\r | |
140 | #define _SC_OPEN_MAX 5\r | |
141 | #define _SC_JOB_CONTROL 6\r | |
142 | #define _SC_SAVED_IDS 7\r | |
143 | #define _SC_VERSION 8\r | |
144 | #define _SC_BC_BASE_MAX 9\r | |
145 | #define _SC_BC_DIM_MAX 10\r | |
146 | #define _SC_BC_SCALE_MAX 11\r | |
147 | #define _SC_BC_STRING_MAX 12\r | |
148 | #define _SC_COLL_WEIGHTS_MAX 13\r | |
149 | #define _SC_EXPR_NEST_MAX 14\r | |
150 | #define _SC_LINE_MAX 15\r | |
151 | #define _SC_RE_DUP_MAX 16\r | |
152 | #define _SC_2_VERSION 17\r | |
153 | #define _SC_2_C_BIND 18\r | |
154 | #define _SC_2_C_DEV 19\r | |
155 | #define _SC_2_CHAR_TERM 20\r | |
156 | #define _SC_2_FORT_DEV 21\r | |
157 | #define _SC_2_FORT_RUN 22\r | |
158 | #define _SC_2_LOCALEDEF 23\r | |
159 | #define _SC_2_SW_DEV 24\r | |
160 | #define _SC_2_UPE 25\r | |
161 | #define _SC_STREAM_MAX 26\r | |
162 | #define _SC_TZNAME_MAX 27\r | |
163 | #define _SC_PAGESIZE 28\r | |
164 | #define _SC_PAGE_SIZE _SC_PAGESIZE /* 1170 compatibility */\r | |
165 | #define _SC_FSYNC 29\r | |
166 | #define _SC_XOPEN_SHM 30\r | |
167 | #define _SC_SYNCHRONIZED_IO 31\r | |
168 | #define _SC_IOV_MAX 32\r | |
169 | #define _SC_MAPPED_FILES 33\r | |
170 | #define _SC_MEMLOCK 34\r | |
171 | #define _SC_MEMLOCK_RANGE 35\r | |
172 | #define _SC_MEMORY_PROTECTION 36\r | |
173 | #define _SC_LOGIN_NAME_MAX 37\r | |
174 | #define _SC_MONOTONIC_CLOCK 38\r | |
175 | #define _SC_CLK_TCK 39 /* New, variable version */\r | |
176 | #define _SC_ATEXIT_MAX 40\r | |
177 | #define _SC_THREADS 41\r | |
178 | #define _SC_SEMAPHORES 42\r | |
179 | #define _SC_BARRIERS 43\r | |
180 | #define _SC_TIMERS 44\r | |
181 | #define _SC_SPIN_LOCKS 45\r | |
182 | #define _SC_READER_WRITER_LOCKS 46\r | |
183 | #define _SC_GETGR_R_SIZE_MAX 47\r | |
184 | #define _SC_GETPW_R_SIZE_MAX 48\r | |
185 | #define _SC_CLOCK_SELECTION 49\r | |
186 | \r | |
187 | /* configurable system strings */\r | |
188 | #define _CS_PATH 1\r | |
189 | \r | |
190 | #endif /* !_SYS_UNISTD_H_ */\r |