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