00001 /*- 00002 * Copyright (c) 1991, 1993, 1994 00003 * The Regents of the University of California. All rights reserved. 00004 * 00005 * Redistribution and use in source and binary forms, with or without 00006 * modification, are permitted provided that the following conditions 00007 * are met: 00008 * 1. Redistributions of source code must retain the above copyright 00009 * notice, this list of conditions and the following disclaimer. 00010 * 2. Redistributions in binary form must reproduce the above copyright 00011 * notice, this list of conditions and the following disclaimer in the 00012 * documentation and/or other materials provided with the distribution. 00013 * 3. All advertising materials mentioning features or use of this software 00014 * must display the following acknowledgement: 00015 * This product includes software developed by the University of 00016 * California, Berkeley and its contributors. 00017 * 4. Neither the name of the University nor the names of its contributors 00018 * may be used to endorse or promote products derived from this software 00019 * without specific prior written permission. 00020 * 00021 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 00022 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00023 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00024 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 00025 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00026 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00027 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00028 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00029 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00030 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00031 * SUCH DAMAGE. 00032 * 00033 * @(#)unistd.h 8.12 (Berkeley) 4/27/95 00034 * $FreeBSD: src/include/unistd.h,v 1.69 2003/08/19 20:39:49 wollman Exp $ 00035 */ 00036 00037 #ifndef _UNISTD_H_ 00038 #define _UNISTD_H_ 00039 00040 #include <sys/cdefs.h> 00041 #include <sys/types.h> /* XXX adds too much pollution. */ 00042 //#include <sys/unistd.h> 00043 #include <sys/_types.h> 00044 00045 #define O_RDONLY 1 00046 #define O_WRONLY 2 00047 #define O_RDWR 3 00048 #define O_CREAT 4 00049 #define O_TRUNC 8 00050 #define O_APPEND 16 00051 00052 #define STDIN_FILENO 0 00053 #define STDOUT_FILENO 1 00054 #define STDERR_FILENO 2 00055 00056 #ifndef _GID_T_DECLARED 00057 typedef __gid_t gid_t; 00058 #define _GID_T_DECLARED 00059 #endif 00060 00061 #ifndef _OFF_T_DECLARED 00062 typedef __off_t off_t; 00063 #define _OFF_T_DECLARED 00064 #endif 00065 00066 #ifndef _PID_T_DECLARED 00067 typedef __pid_t pid_t; 00068 #define _PID_T_DECLARED 00069 #endif 00070 00071 #ifndef _SIZE_T_DECLARED 00072 typedef __size_t size_t; 00073 #define _SIZE_T_DECLARED 00074 #endif 00075 00076 #ifndef _SSIZE_T_DECLARED 00077 typedef __ssize_t ssize_t; 00078 #define _SSIZE_T_DECLARED 00079 #endif 00080 00081 #ifndef _UID_T_DECLARED 00082 typedef __uid_t uid_t; 00083 #define _UID_T_DECLARED 00084 #endif 00085 00086 #ifndef _USECONDS_T_DECLARED 00087 typedef __useconds_t useconds_t; 00088 #define _USECONDS_T_DECLARED 00089 #endif 00090 00091 #define STDIN_FILENO 0 /* standard input file descriptor */ 00092 #define STDOUT_FILENO 1 /* standard output file descriptor */ 00093 #define STDERR_FILENO 2 /* standard error file descriptor */ 00094 00095 #ifndef NULL 00096 #define NULL 0 /* null pointer constant */ 00097 #endif 00098 00099 #if __XSI_VISIBLE || __POSIX_VISIBLE >= 200112 00100 #define F_ULOCK 0 /* unlock locked section */ 00101 #define F_LOCK 1 /* lock a section for exclusive use */ 00102 #define F_TLOCK 2 /* test and lock a section for exclusive use */ 00103 #define F_TEST 3 /* test a section for locks by other procs */ 00104 #endif 00105 00106 /* 00107 * POSIX options and option groups we unconditionally do or don't 00108 * implement. This list includes those options which are exclusively 00109 * implemented (or not) in user mode. Please keep this list in 00110 * alphabetical order. 00111 * 00112 * Anything which is defined as zero below **must** have an 00113 * implementation for the corresponding sysconf() which is able to 00114 * determine conclusively whether or not the feature is supported. 00115 * Anything which is defined as other than -1 below **must** have 00116 * complete headers, types, and function declarations as specified by 00117 * the POSIX standard; however, if the relevant sysconf() function 00118 * returns -1, the functions may be stubbed out. 00119 */ 00120 #define _POSIX_BARRIERS -1 00121 #define _POSIX_READER_WRITER_LOCKS 200112L 00122 #define _POSIX_REGEXP 1 00123 #define _POSIX_SHELL 1 00124 #define _POSIX_SPAWN -1 00125 #define _POSIX_SPIN_LOCKS -1 00126 #define _POSIX_THREAD_ATTR_STACKADDR 200112L 00127 #define _POSIX_THREAD_ATTR_STACKSIZE 200112L 00128 #define _POSIX_THREAD_CPUTIME -1 00129 #define _POSIX_THREAD_PRIO_INHERIT 200112L 00130 #define _POSIX_THREAD_PRIO_PROTECT 200112L 00131 #define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L 00132 #define _POSIX_THREAD_PROCESS_SHARED -1 00133 #define _POSIX_THREAD_SAFE_FUNCTIONS -1 00134 #define _POSIX_THREAD_SPORADIC_SERVER -1 00135 #define _POSIX_THREADS 200112L 00136 #define _POSIX_TRACE -1 00137 #define _POSIX_TRACE_EVENT_FILTER -1 00138 #define _POSIX_TRACE_INHERIT -1 00139 #define _POSIX_TRACE_LOG -1 00140 #define _POSIX2_C_BIND 200112L /* mandatory */ 00141 #define _POSIX2_C_DEV -1 /* need c99 utility */ 00142 #define _POSIX2_CHAR_TERM 1 00143 #define _POSIX2_FORT_DEV -1 /* need fort77 utility */ 00144 #define _POSIX2_FORT_RUN 200112L 00145 #define _POSIX2_LOCALEDEF -1 00146 #define _POSIX2_PBS -1 00147 #define _POSIX2_PBS_ACCOUNTING -1 00148 #define _POSIX2_PBS_CHECKPOINT -1 00149 #define _POSIX2_PBS_LOCATE -1 00150 #define _POSIX2_PBS_MESSAGE -1 00151 #define _POSIX2_PBS_TRACK -1 00152 #define _POSIX2_SW_DEV -1 /* XXX ??? */ 00153 #define _POSIX2_UPE 200112L 00154 #define _V6_ILP32_OFF32 -1 00155 #define _V6_ILP32_OFFBIG 0 00156 #define _V6_LP64_OFF64 0 00157 #define _V6_LPBIG_OFFBIG -1 00158 00159 #if __XSI_VISIBLE 00160 #define _XOPEN_CRYPT -1 /* XXX ??? */ 00161 #define _XOPEN_ENH_I18N -1 /* mandatory in XSI */ 00162 #define _XOPEN_LEGACY -1 00163 #define _XOPEN_REALTIME -1 00164 #define _XOPEN_REALTIME_THREADS -1 00165 #define _XOPEN_UNIX -1 00166 #endif 00167 00168 /* Define the POSIX.2 version we target for compliance. */ 00169 #define _POSIX2_VERSION 199212L 00170 00171 /* 00172 * POSIX-style system configuration variable accessors (for the 00173 * sysconf function). The kernel does not directly implement the 00174 * sysconf() interface; rather, a C library stub translates references 00175 * to sysconf() into calls to sysctl() using a giant switch statement. 00176 * Those that are marked `user' are implemented entirely in the C 00177 * library and never query the kernel. pathconf() is implemented 00178 * directly by the kernel so those are not defined here. 00179 */ 00180 #define _SC_ARG_MAX 1 00181 #define _SC_CHILD_MAX 2 00182 #define _SC_CLK_TCK 3 00183 #define _SC_NGROUPS_MAX 4 00184 #define _SC_OPEN_MAX 5 00185 #define _SC_JOB_CONTROL 6 00186 #define _SC_SAVED_IDS 7 00187 #define _SC_VERSION 8 00188 #define _SC_BC_BASE_MAX 9 /* user */ 00189 #define _SC_BC_DIM_MAX 10 /* user */ 00190 #define _SC_BC_SCALE_MAX 11 /* user */ 00191 #define _SC_BC_STRING_MAX 12 /* user */ 00192 #define _SC_COLL_WEIGHTS_MAX 13 /* user */ 00193 #define _SC_EXPR_NEST_MAX 14 /* user */ 00194 #define _SC_LINE_MAX 15 /* user */ 00195 #define _SC_RE_DUP_MAX 16 /* user */ 00196 #define _SC_2_VERSION 17 /* user */ 00197 #define _SC_2_C_BIND 18 /* user */ 00198 #define _SC_2_C_DEV 19 /* user */ 00199 #define _SC_2_CHAR_TERM 20 /* user */ 00200 #define _SC_2_FORT_DEV 21 /* user */ 00201 #define _SC_2_FORT_RUN 22 /* user */ 00202 #define _SC_2_LOCALEDEF 23 /* user */ 00203 #define _SC_2_SW_DEV 24 /* user */ 00204 #define _SC_2_UPE 25 /* user */ 00205 #define _SC_STREAM_MAX 26 /* user */ 00206 #define _SC_TZNAME_MAX 27 /* user */ 00207 00208 #if __POSIX_VISIBLE >= 199309 00209 #define _SC_ASYNCHRONOUS_IO 28 00210 #define _SC_MAPPED_FILES 29 00211 #define _SC_MEMLOCK 30 00212 #define _SC_MEMLOCK_RANGE 31 00213 #define _SC_MEMORY_PROTECTION 32 00214 #define _SC_MESSAGE_PASSING 33 00215 #define _SC_PRIORITIZED_IO 34 00216 #define _SC_PRIORITY_SCHEDULING 35 00217 #define _SC_REALTIME_SIGNALS 36 00218 #define _SC_SEMAPHORES 37 00219 #define _SC_FSYNC 38 00220 #define _SC_SHARED_MEMORY_OBJECTS 39 00221 #define _SC_SYNCHRONIZED_IO 40 00222 #define _SC_TIMERS 41 00223 #define _SC_AIO_LISTIO_MAX 42 00224 #define _SC_AIO_MAX 43 00225 #define _SC_AIO_PRIO_DELTA_MAX 44 00226 #define _SC_DELAYTIMER_MAX 45 00227 #define _SC_MQ_OPEN_MAX 46 00228 #define _SC_PAGESIZE 47 00229 #define _SC_RTSIG_MAX 48 00230 #define _SC_SEM_NSEMS_MAX 49 00231 #define _SC_SEM_VALUE_MAX 50 00232 #define _SC_SIGQUEUE_MAX 51 00233 #define _SC_TIMER_MAX 52 00234 #endif 00235 00236 #if __POSIX_VISIBLE >= 200112 00237 #define _SC_2_PBS 59 /* user */ 00238 #define _SC_2_PBS_ACCOUNTING 60 /* user */ 00239 #define _SC_2_PBS_CHECKPOINT 61 /* user */ 00240 #define _SC_2_PBS_LOCATE 62 /* user */ 00241 #define _SC_2_PBS_MESSAGE 63 /* user */ 00242 #define _SC_2_PBS_TRACK 64 /* user */ 00243 #define _SC_ADVISORY_INFO 65 00244 #define _SC_BARRIERS 66 /* user */ 00245 #define _SC_CLOCK_SELECTION 67 00246 #define _SC_CPUTIME 68 00247 #define _SC_FILE_LOCKING 69 00248 #define _SC_GETGR_R_SIZE_MAX 70 /* user */ 00249 #define _SC_GETPW_R_SIZE_MAX 71 /* user */ 00250 #define _SC_HOST_NAME_MAX 72 00251 #define _SC_LOGIN_NAME_MAX 73 00252 #define _SC_MONOTONIC_CLOCK 74 00253 #define _SC_MQ_PRIO_MAX 75 00254 #define _SC_READER_WRITER_LOCKS 76 /* user */ 00255 #define _SC_REGEXP 77 /* user */ 00256 #define _SC_SHELL 78 /* user */ 00257 #define _SC_SPAWN 79 /* user */ 00258 #define _SC_SPIN_LOCKS 80 /* user */ 00259 #define _SC_SPORADIC_SERVER 81 00260 #define _SC_THREAD_ATTR_STACKADDR 82 /* user */ 00261 #define _SC_THREAD_ATTR_STACKSIZE 83 /* user */ 00262 #define _SC_THREAD_CPUTIME 84 /* user */ 00263 #define _SC_THREAD_DESTRUCTOR_ITERATIONS 85 /* user */ 00264 #define _SC_THREAD_KEYS_MAX 86 /* user */ 00265 #define _SC_THREAD_PRIO_INHERIT 87 /* user */ 00266 #define _SC_THREAD_PRIO_PROTECT 88 /* user */ 00267 #define _SC_THREAD_PRIORITY_SCHEDULING 89 /* user */ 00268 #define _SC_THREAD_PROCESS_SHARED 90 /* user */ 00269 #define _SC_THREAD_SAFE_FUNCTIONS 91 /* user */ 00270 #define _SC_THREAD_SPORADIC_SERVER 92 /* user */ 00271 #define _SC_THREAD_STACK_MIN 93 /* user */ 00272 #define _SC_THREAD_THREADS_MAX 94 /* user */ 00273 #define _SC_TIMEOUTS 95 /* user */ 00274 #define _SC_THREADS 96 /* user */ 00275 #define _SC_TRACE 97 /* user */ 00276 #define _SC_TRACE_EVENT_FILTER 98 /* user */ 00277 #define _SC_TRACE_INHERIT 99 /* user */ 00278 #define _SC_TRACE_LOG 100 /* user */ 00279 #define _SC_TTY_NAME_MAX 101 /* user */ 00280 #define _SC_TYPED_MEMORY_OBJECTS 102 00281 #define _SC_V6_ILP32_OFF32 103 /* user */ 00282 #define _SC_V6_ILP32_OFFBIG 104 /* user */ 00283 #define _SC_V6_LP64_OFF64 105 /* user */ 00284 #define _SC_V6_LPBIG_OFFBIG 106 /* user */ 00285 #define _SC_IPV6 118 00286 #define _SC_RAW_SOCKETS 119 00287 #define _SC_SYMLOOP_MAX 120 00288 #endif 00289 00290 #if __XSI_VISIBLE 00291 #define _SC_ATEXIT_MAX 107 /* user */ 00292 #define _SC_IOV_MAX 56 00293 #define _SC_PAGE_SIZE _SC_PAGESIZE 00294 #define _SC_XOPEN_CRYPT 108 /* user */ 00295 #define _SC_XOPEN_ENH_I18N 109 /* user */ 00296 #define _SC_XOPEN_LEGACY 110 /* user */ 00297 #define _SC_XOPEN_REALTIME 111 00298 #define _SC_XOPEN_REALTIME_THREADS 112 00299 #define _SC_XOPEN_SHM 113 00300 #define _SC_XOPEN_STREAMS 114 00301 #define _SC_XOPEN_UNIX 115 00302 #define _SC_XOPEN_VERSION 116 00303 #define _SC_XOPEN_XCU_VERSION 117 /* user */ 00304 #endif 00305 00306 #if __BSD_VISIBLE 00307 #define _SC_NPROCESSORS_CONF 57 00308 #define _SC_NPROCESSORS_ONLN 58 00309 #endif 00310 00311 /* Keys for the confstr(3) function. */ 00312 #if __POSIX_VISIBLE >= 199209 00313 #define _CS_PATH 1 /* default value of PATH */ 00314 #endif 00315 00316 #if __POSIX_VISIBLE >= 200112 00317 #define _CS_POSIX_V6_ILP32_OFF32_CFLAGS 2 00318 #define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS 3 00319 #define _CS_POSIX_V6_ILP32_OFF32_LIBS 4 00320 #define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS 5 00321 #define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS 6 00322 #define _CS_POSIX_V6_ILP32_OFFBIG_LIBS 7 00323 #define _CS_POSIX_V6_LP64_OFF64_CFLAGS 8 00324 #define _CS_POSIX_V6_LP64_OFF64_LDFLAGS 9 00325 #define _CS_POSIX_V6_LP64_OFF64_LIBS 10 00326 #define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS 11 00327 #define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS 12 00328 #define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS 13 00329 #define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 14 00330 #endif 00331 00332 __BEGIN_DECLS 00333 /* 1003.1-1990 */ 00334 void _exit(short) __dead2; 00335 #ifdef HAVE_FULL_OS 00336 int access(const char *, int); 00337 unsigned int alarm(unsigned int); 00338 int chdir(const char *); 00339 int chown(const char *, uid_t, gid_t); 00340 int close(int); 00341 int dup(int); 00342 int dup2(int, int); 00343 int eaccess(const char *, int); 00344 int execl(const char *, const char *, ...); 00345 int execle(const char *, const char *, ...); 00346 int execlp(const char *, const char *, ...); 00347 int execv(const char *, char * const *); 00348 int execve(const char *, char * const *, char * const *); 00349 int execvp(const char *, char * const *); 00350 pid_t fork(void); 00351 long fpathconf(int, int); 00352 char *getcwd(char *, size_t); 00353 gid_t getegid(void); 00354 uid_t geteuid(void); 00355 gid_t getgid(void); 00356 int getgroups(int, gid_t []); 00357 char *getlogin(void); 00358 pid_t getpgrp(void); 00359 pid_t getpid(void); 00360 pid_t getppid(void); 00361 uid_t getuid(void); 00362 int isatty(int); 00363 int link(const char *, const char *); 00364 #ifndef _LSEEK_DECLARED 00365 #define _LSEEK_DECLARED 00366 off_t lseek(int, off_t, int); 00367 #endif 00368 long pathconf(const char *, int); 00369 int pause(void); 00370 int pipe(int *); 00371 #endif 00372 ssize_t read(int, void *, size_t); 00373 #ifdef HAVE_FULL_OS 00374 int rmdir(const char *); 00375 int setgid(gid_t); 00376 int setpgid(pid_t, pid_t); 00377 void setproctitle(const char *_fmt, ...) __printf0like(1, 2); 00378 pid_t setsid(void); 00379 int setuid(uid_t); 00380 #endif 00381 unsigned int sleep(unsigned int); 00382 #ifdef HAVE_FULL_OS 00383 long sysconf(int); 00384 pid_t tcgetpgrp(int); 00385 int tcsetpgrp(int, pid_t); 00386 char *ttyname(int); 00387 int unlink(const char *); 00388 #endif 00389 ssize_t write(int, const void *, size_t); 00390 00391 #ifdef HAVE_FULL_OS 00392 /* 1003.2-1992 */ 00393 #if __POSIX_VISIBLE >= 199209 || __XSI_VISIBLE 00394 size_t confstr(int, char *, size_t); 00395 int getopt(int, char * const [], const char *); 00396 00397 extern char *optarg; /* getopt(3) external variables */ 00398 extern int optind, opterr, optopt; 00399 #endif 00400 00401 /* ISO/IEC 9945-1: 1996 */ 00402 #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE 00403 int fsync(int); 00404 00405 /* 00406 * ftruncate() was in the POSIX Realtime Extension (it's used for shared 00407 * memory), but truncate() was not. 00408 */ 00409 #ifndef _FTRUNCATE_DECLARED 00410 #define _FTRUNCATE_DECLARED 00411 int ftruncate(int, off_t); 00412 #endif 00413 #endif 00414 00415 #if __POSIX_VISIBLE >= 199506 00416 int getlogin_r(char *, int); 00417 #endif 00418 00419 /* 1003.1-2001 */ 00420 #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE 00421 int fchown(int, uid_t, gid_t); 00422 int readlink(const char *, char *, int); 00423 #endif 00424 #if __POSIX_VISIBLE >= 200112 00425 int gethostname(char *, size_t); 00426 int setegid(gid_t); 00427 int seteuid(uid_t); 00428 #endif 00429 00430 /* 00431 * symlink() was originally in POSIX.1a, which was withdrawn after 00432 * being overtaken by events (1003.1-2001). It was in XPG4.2, and of 00433 * course has been in BSD since 4.2. 00434 */ 00435 #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 402 || __BSD_VISIBLE 00436 int symlink(const char * __restrict, const char * __restrict); 00437 #endif 00438 00439 /* X/Open System Interfaces */ 00440 #if __XSI_VISIBLE 00441 char *crypt(const char *, const char *); 00442 /* char *ctermid(char *); */ /* XXX ??? */ 00443 int encrypt(char *, int); 00444 int fchdir(int); 00445 long gethostid(void); 00446 int getpgid(pid_t _pid); 00447 int getsid(pid_t _pid); 00448 char *getwd(char *); /* LEGACY: obsoleted by getcwd() */ 00449 int lchown(const char *, uid_t, gid_t); 00450 int lockf(int, int, off_t); 00451 int nice(int); 00452 ssize_t pread(int, void *, size_t, off_t); 00453 ssize_t pwrite(int, const void *, size_t, off_t); 00454 int setpgrp(pid_t _pid, pid_t _pgrp); /* obsoleted by setpgid() */ 00455 int setregid(gid_t, gid_t); 00456 int setreuid(uid_t, uid_t); 00457 /* void swab(const void * __restrict, void * __restrict, ssize_t); */ 00458 void sync(void); 00459 useconds_t ualarm(useconds_t, useconds_t); 00460 int usleep(useconds_t); 00461 pid_t vfork(void); 00462 00463 /* See comment at ftruncate() above. */ 00464 #ifndef _TRUNCATE_DECLARED 00465 #define _TRUNCATE_DECLARED 00466 int truncate(const char *, off_t); 00467 #endif 00468 #endif /* __XSI_VISIBLE */ 00469 #endif /* HAVE_FULL_OS */ 00470 00471 #if __XSI_VISIBLE <= 500 || __BSD_VISIBLE 00472 int brk(const void *); 00473 #ifdef HAVE_FULL_OS 00474 int chroot(const char *); 00475 int getdtablesize(void); 00476 int getpagesize(void) __pure2; 00477 char *getpass(const char *); 00478 #endif 00479 void *sbrk(intptr_t); 00480 #endif 00481 00482 #if __BSD_VISIBLE 00483 #ifdef HAVE_FULL_OS 00484 struct timeval; /* select(2) */ 00485 int acct(const char *); 00486 int async_daemon(void); 00487 int check_utility_compat(const char *); 00488 const char * 00489 crypt_get_format(void); 00490 int crypt_set_format(const char *); 00491 int des_cipher(const char *, char *, long, int); 00492 int des_setkey(const char *key); 00493 void endusershell(void); 00494 int exect(const char *, char * const *, char * const *); 00495 int execvP(const char *, const char *, char * const *); 00496 char *fflagstostr(u_long); 00497 int getdomainname(char *, int); 00498 int getgrouplist(const char *, gid_t, gid_t *, int *); 00499 mode_t getmode(const void *, mode_t); 00500 int getpeereid(int, uid_t *, gid_t *); 00501 int getresgid(gid_t *, gid_t *, gid_t *); 00502 int getresuid(uid_t *, uid_t *, uid_t *); 00503 char *getusershell(void); 00504 int initgroups(const char *, gid_t); 00505 int iruserok(unsigned long, int, const char *, const char *); 00506 int iruserok_sa(const void *, int, int, const char *, const char *); 00507 int issetugid(void); 00508 char *mkdtemp(char *); 00509 int mknod(const char *, mode_t, dev_t); 00510 #ifndef _MKSTEMP_DECLARED 00511 int mkstemp(char *); 00512 #define _MKSTEMP_DECLARED 00513 #endif 00514 int mkstemps(char *, int); 00515 #ifndef _MKTEMP_DECLARED 00516 char *mktemp(char *); 00517 #define _MKTEMP_DECLARED 00518 #endif 00519 int nfsclnt(int, void *); 00520 int nfssvc(int, void *); 00521 int profil(char *, size_t, vm_offset_t, int); 00522 int rcmd(char **, int, const char *, const char *, const char *, int *); 00523 int rcmd_af(char **, int, const char *, 00524 const char *, const char *, int *, int); 00525 int rcmdsh(char **, int, const char *, 00526 const char *, const char *, const char *); 00527 char *re_comp(const char *); 00528 int re_exec(const char *); 00529 int reboot(int); 00530 int revoke(const char *); 00531 pid_t rfork(int); 00532 pid_t rfork_thread(int, void *, int (*)(void *), void *); 00533 int rresvport(int *); 00534 int rresvport_af(int *, int); 00535 int ruserok(const char *, int, const char *, const char *); 00536 #if __BSD_VISIBLE 00537 #ifndef _SELECT_DECLARED 00538 #define _SELECT_DECLARED 00539 int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); 00540 #endif 00541 #endif 00542 int setdomainname(const char *, int); 00543 int setgroups(int, const gid_t *); 00544 void sethostid(long); 00545 int sethostname(const char *, int); 00546 #ifndef _SETKEY_DECLARED 00547 int setkey(const char *); 00548 #define _SETKEY_DECLARED 00549 #endif 00550 int setlogin(const char *); 00551 void *setmode(const char *); 00552 int setresgid(gid_t, gid_t, gid_t); 00553 int setresuid(uid_t, uid_t, uid_t); 00554 int setrgid(gid_t); 00555 int setruid(uid_t); 00556 void setusershell(void); 00557 int strtofflags(char **, u_long *, u_long *); 00558 int swapon(const char *); 00559 int swapoff(const char *); 00560 int syscall(int, ...); 00561 off_t __syscall(quad_t, ...); 00562 int ttyslot(void); 00563 int undelete(const char *); 00564 int unwhiteout(const char *); 00565 void *valloc(size_t); /* obsoleted by malloc() */ 00566 00567 extern char *suboptarg; /* getsubopt(3) external variable */ 00568 #ifndef _GETSUBOPT_DECLARED 00569 int getsubopt(char **, char * const *, char **); 00570 #define _GETSUBOPT_DECLARED 00571 #endif 00572 extern int optreset; /* getopt(3) external variable */ 00573 #endif 00574 #endif /* __BSD_VISIBLE */ 00575 __END_DECLS 00576 00577 #endif /* !_UNISTD_H_ */