sys/unistd.h

Go to the documentation of this file.
00001 /*-
00002  * Copyright (c) 1989, 1993
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  * 4. Neither the name of the University nor the names of its contributors
00014  *    may be used to endorse or promote products derived from this software
00015  *    without specific prior written permission.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
00021  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00023  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00024  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00025  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00026  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00027  * SUCH DAMAGE.
00028  * © Portions copyright (c) 2007 Symbian Software Ltd. All rights reserved.
00029  *      @(#)unistd.h    8.2 (Berkeley) 1/7/94
00030  * $FreeBSD: src/sys/sys/unistd.h,v 1.41 2005/01/07 02:29:24 imp Exp $
00031  */
00032 
00033 #ifndef _SYS_UNISTD_H_
00034 #define _SYS_UNISTD_H_
00035 
00036 #include <sys/cdefs.h>
00037 
00038 /*
00039  * POSIX options and option groups we unconditionally do or don't
00040  * implement.  Those options which are implemented (or not) entirely
00041  * in user mode are defined in <unistd.h>.  Please keep this list in
00042  * alphabetical order.
00043  *
00044  * Anything which is defined as zero below **must** have an
00045  * implementation for the corresponding sysconf() which is able to
00046  * determine conclusively whether or not the feature is supported.
00047  * Anything which is defined as other than -1 below **must** have
00048  * complete headers, types, and function declarations as specified by
00049  * the POSIX standard; however, if the relevant sysconf() function
00050  * returns -1, the functions may be stubbed out.
00051  */
00052 #define _POSIX_ADVISORY_INFO            -1
00053 #define _POSIX_ASYNCHRONOUS_IO          0
00054 #define _POSIX_CHOWN_RESTRICTED         1
00055 #define _POSIX_CLOCK_SELECTION          -1
00056 #define _POSIX_CPUTIME                  -1
00057 #define _POSIX_FSYNC                    200112L
00058 #define _POSIX_IPV6                     0
00059 #define _POSIX_JOB_CONTROL              1
00060 #define _POSIX_MAPPED_FILES             200112L
00061 #define _POSIX_MEMLOCK                  -1
00062 #define _POSIX_MEMLOCK_RANGE            200112L
00063 #define _POSIX_MEMORY_PROTECTION        200112L
00064 #define _POSIX_MESSAGE_PASSING          -1
00065 #define _POSIX_MONOTONIC_CLOCK          -1
00066 #define _POSIX_NO_TRUNC                 1
00067 #define _POSIX_PRIORITIZED_IO           -1
00068 #define _POSIX_PRIORITY_SCHEDULING      200112L
00069 #define _POSIX_RAW_SOCKETS              200112L
00070 #define _POSIX_REALTIME_SIGNALS         -1
00071 #define _POSIX_SEMAPHORES               -1
00072 #define _POSIX_SHARED_MEMORY_OBJECTS    200112L
00073 #define _POSIX_SPORADIC_SERVER          -1
00074 #define _POSIX_SYNCHRONIZED_IO          -1
00075 #define _POSIX_TIMEOUTS                 -1
00076 #define _POSIX_TYPED_MEMORY_OBJECTS     -1
00077 #define _POSIX_VDISABLE                 0xff
00078 
00079 #if __XSI_VISIBLE
00080 #define _XOPEN_SHM                      1
00081 #define _XOPEN_STREAMS                  -1
00082 #endif
00083 
00084 /*
00085  * Although we have saved user/group IDs, we do not use them in setuid
00086  * as described in POSIX 1003.1, because the feature does not work for
00087  * root.  We use the saved IDs in seteuid/setegid, which are not currently
00088  * part of the POSIX 1003.1 specification.  XXX revisit for 1003.1-2001
00089  * as this is now mandatory.
00090  */
00091 #ifdef  _NOT_AVAILABLE
00092 #define _POSIX_SAVED_IDS        1 /* saved set-user-ID and set-group-ID */
00093 #endif
00094 
00095 /* Define the POSIX.1 version we target for compliance. */
00096 #define _POSIX_VERSION          200112L
00097 
00098 /* access function */
00099 #define F_OK            0       /* test for existence of file */
00100 #define X_OK            0x01    /* test for execute or search permission */
00101 #define W_OK            0x02    /* test for write permission */
00102 #define R_OK            0x04    /* test for read permission */
00103 
00104 /* whence values for lseek(2) */
00105 #ifndef SEEK_SET
00106 #define SEEK_SET        0       /* set file offset to offset */
00107 #define SEEK_CUR        1       /* set file offset to current plus offset */
00108 #define SEEK_END        2       /* set file offset to EOF plus offset */
00109 #endif
00110 
00111 #ifndef _POSIX_SOURCE
00112 /* whence values for lseek(2); renamed by POSIX 1003.1 */
00113 #define L_SET           SEEK_SET
00114 #define L_INCR          SEEK_CUR
00115 #define L_XTND          SEEK_END
00116 #endif
00117 
00118 /* configurable pathname variables */
00119 #define _PC_LINK_MAX             1
00120 #define _PC_MAX_CANON            2
00121 #define _PC_MAX_INPUT            3
00122 #define _PC_NAME_MAX             4
00123 #define _PC_PATH_MAX             5
00124 #define _PC_PIPE_BUF             6
00125 #define _PC_CHOWN_RESTRICTED     7
00126 #define _PC_NO_TRUNC             8
00127 #define _PC_VDISABLE             9
00128 
00129 /*
00130 #if __POSIX_VISIBLE >= 199309
00131 #define _PC_ASYNC_IO            53
00132 #define _PC_PRIO_IO             54
00133 #define _PC_SYNC_IO             55
00134 #endif
00135 
00136 
00137 #if __POSIX_VISIBLE >= 200112
00138 #define _PC_ALLOC_SIZE_MIN      10
00139 #define _PC_FILESIZEBITS        12
00140 #define _PC_REC_INCR_XFER_SIZE  14
00141 #define _PC_REC_MAX_XFER_SIZE   15
00142 #define _PC_REC_MIN_XFER_SIZE   16
00143 #define _PC_REC_XFER_ALIGN      17
00144 #define _PC_SYMLINK_MAX         18
00145 #endif
00146 
00147 #if __BSD_VISIBLE
00148 #define _PC_ACL_EXTENDED        59
00149 #define _PC_ACL_PATH_MAX        60
00150 #define _PC_CAP_PRESENT         61
00151 #define _PC_INF_PRESENT         62
00152 #define _PC_MAC_PRESENT         63
00153 #endif
00154 */
00155 #if __BSD_VISIBLE
00156 /*
00157  * rfork() options.
00158  *
00159  * XXX currently, some operations without RFPROC set are not supported.
00160  */
00161 #define RFNAMEG         (1<<0)  /* UNIMPL new plan9 `name space' */
00162 #define RFENVG          (1<<1)  /* UNIMPL copy plan9 `env space' */
00163 #define RFFDG           (1<<2)  /* copy fd table */
00164 #define RFNOTEG         (1<<3)  /* UNIMPL create new plan9 `note group' */
00165 #define RFPROC          (1<<4)  /* change child (else changes curproc) */
00166 #define RFMEM           (1<<5)  /* share `address space' */
00167 #define RFNOWAIT        (1<<6)  /* give child to init */
00168 #define RFCNAMEG        (1<<10) /* UNIMPL zero plan9 `name space' */
00169 #define RFCENVG         (1<<11) /* UNIMPL zero plan9 `env space' */
00170 #define RFCFDG          (1<<12) /* close all fds, zero fd table */
00171 #define RFTHREAD        (1<<13) /* enable kernel thread support */
00172 #define RFSIGSHARE      (1<<14) /* share signal handlers */
00173 #define RFLINUXTHPN     (1<<16) /* do linux clone exit parent notification */
00174 #define RFSTOPPED       (1<<17) /* leave child in a stopped state */
00175 #define RFHIGHPID       (1<<18) /* use a pid higher then 10 (idleproc) */
00176 #define RFPPWAIT        (1<<31) /* parent sleeps until child exits (vfork) */
00177 #define RFKERNELONLY    (RFSTOPPED | RFHIGHPID | RFPPWAIT)
00178 
00179 #endif /* __BSD_VISIBLE */
00180 
00181 #endif /* !_SYS_UNISTD_H_ */

Copyright © Nokia Corporation 2001-2008
Back to top