os/ossrv/genericopenlibs/openenvcore/include/sys/unistd.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
/*-
sl@0
     2
 * Copyright (c) 1989, 1993
sl@0
     3
 *	The Regents of the University of California.  All rights reserved.
sl@0
     4
 *
sl@0
     5
 * Redistribution and use in source and binary forms, with or without
sl@0
     6
 * modification, are permitted provided that the following conditions
sl@0
     7
 * are met:
sl@0
     8
 * 1. Redistributions of source code must retain the above copyright
sl@0
     9
 *    notice, this list of conditions and the following disclaimer.
sl@0
    10
 * 2. Redistributions in binary form must reproduce the above copyright
sl@0
    11
 *    notice, this list of conditions and the following disclaimer in the
sl@0
    12
 *    documentation and/or other materials provided with the distribution.
sl@0
    13
 * 4. Neither the name of the University nor the names of its contributors
sl@0
    14
 *    may be used to endorse or promote products derived from this software
sl@0
    15
 *    without specific prior written permission.
sl@0
    16
 *
sl@0
    17
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
sl@0
    18
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
sl@0
    19
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
sl@0
    20
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
sl@0
    21
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
sl@0
    22
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
sl@0
    23
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
sl@0
    24
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
sl@0
    25
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
sl@0
    26
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
sl@0
    27
 * SUCH DAMAGE.
sl@0
    28
 * © * Portions Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).  All rights reserved.
sl@0
    29
 *	@(#)unistd.h	8.2 (Berkeley) 1/7/94
sl@0
    30
 * $FreeBSD: src/sys/sys/unistd.h,v 1.41 2005/01/07 02:29:24 imp Exp $
sl@0
    31
 */
sl@0
    32
sl@0
    33
#ifndef _SYS_UNISTD_H_
sl@0
    34
#define	_SYS_UNISTD_H_
sl@0
    35
sl@0
    36
#include <sys/cdefs.h>
sl@0
    37
sl@0
    38
/*
sl@0
    39
 * POSIX options and option groups we unconditionally do or don't
sl@0
    40
 * implement.  Those options which are implemented (or not) entirely
sl@0
    41
 * in user mode are defined in <unistd.h>.  Please keep this list in
sl@0
    42
 * alphabetical order.
sl@0
    43
 *
sl@0
    44
 * Anything which is defined as zero below **must** have an
sl@0
    45
 * implementation for the corresponding sysconf() which is able to
sl@0
    46
 * determine conclusively whether or not the feature is supported.
sl@0
    47
 * Anything which is defined as other than -1 below **must** have
sl@0
    48
 * complete headers, types, and function declarations as specified by
sl@0
    49
 * the POSIX standard; however, if the relevant sysconf() function
sl@0
    50
 * returns -1, the functions may be stubbed out.
sl@0
    51
 */
sl@0
    52
#define	_POSIX_ADVISORY_INFO		-1
sl@0
    53
#define	_POSIX_ASYNCHRONOUS_IO		0
sl@0
    54
#define	_POSIX_CHOWN_RESTRICTED		1
sl@0
    55
#define	_POSIX_CLOCK_SELECTION		-1
sl@0
    56
#define	_POSIX_CPUTIME			-1
sl@0
    57
#define	_POSIX_FSYNC			200112L
sl@0
    58
#define	_POSIX_IPV6			0
sl@0
    59
#define	_POSIX_JOB_CONTROL		1
sl@0
    60
#define	_POSIX_MAPPED_FILES		200112L
sl@0
    61
#define	_POSIX_MEMLOCK			-1
sl@0
    62
#define	_POSIX_MEMLOCK_RANGE		200112L
sl@0
    63
#define	_POSIX_MEMORY_PROTECTION	200112L
sl@0
    64
#define	_POSIX_MESSAGE_PASSING		-1
sl@0
    65
#define	_POSIX_MONOTONIC_CLOCK		-1
sl@0
    66
#define	_POSIX_NO_TRUNC			1
sl@0
    67
#define	_POSIX_PRIORITIZED_IO		-1
sl@0
    68
#define	_POSIX_PRIORITY_SCHEDULING	200112L
sl@0
    69
#define	_POSIX_RAW_SOCKETS		200112L
sl@0
    70
#define	_POSIX_REALTIME_SIGNALS		-1
sl@0
    71
#define	_POSIX_SEMAPHORES		-1
sl@0
    72
#define	_POSIX_SHARED_MEMORY_OBJECTS	200112L
sl@0
    73
#define	_POSIX_SPORADIC_SERVER		-1
sl@0
    74
#define	_POSIX_SYNCHRONIZED_IO		-1
sl@0
    75
#define	_POSIX_TIMEOUTS			-1
sl@0
    76
#define	_POSIX_TYPED_MEMORY_OBJECTS	-1
sl@0
    77
#define	_POSIX_VDISABLE			0xff
sl@0
    78
sl@0
    79
#if __XSI_VISIBLE
sl@0
    80
#define	_XOPEN_SHM			1
sl@0
    81
#define	_XOPEN_STREAMS			-1
sl@0
    82
#endif
sl@0
    83
sl@0
    84
/*
sl@0
    85
 * Although we have saved user/group IDs, we do not use them in setuid
sl@0
    86
 * as described in POSIX 1003.1, because the feature does not work for
sl@0
    87
 * root.  We use the saved IDs in seteuid/setegid, which are not currently
sl@0
    88
 * part of the POSIX 1003.1 specification.  XXX revisit for 1003.1-2001
sl@0
    89
 * as this is now mandatory.
sl@0
    90
 */
sl@0
    91
#ifdef	_NOT_AVAILABLE
sl@0
    92
#define	_POSIX_SAVED_IDS	1 /* saved set-user-ID and set-group-ID */
sl@0
    93
#endif
sl@0
    94
sl@0
    95
/* Define the POSIX.1 version we target for compliance. */
sl@0
    96
#define	_POSIX_VERSION		200112L
sl@0
    97
sl@0
    98
/* access function */
sl@0
    99
#define	F_OK		0	/* test for existence of file */
sl@0
   100
#define	X_OK		0x01	/* test for execute or search permission */
sl@0
   101
#define	W_OK		0x02	/* test for write permission */
sl@0
   102
#define	R_OK		0x04	/* test for read permission */
sl@0
   103
sl@0
   104
/* whence values for lseek(2) */
sl@0
   105
#ifndef SEEK_SET
sl@0
   106
#define	SEEK_SET	0	/* set file offset to offset */
sl@0
   107
#define	SEEK_CUR	1	/* set file offset to current plus offset */
sl@0
   108
#define	SEEK_END	2	/* set file offset to EOF plus offset */
sl@0
   109
#endif
sl@0
   110
sl@0
   111
#ifndef _POSIX_SOURCE
sl@0
   112
/* whence values for lseek(2); renamed by POSIX 1003.1 */
sl@0
   113
#define	L_SET		SEEK_SET
sl@0
   114
#define	L_INCR		SEEK_CUR
sl@0
   115
#define	L_XTND		SEEK_END
sl@0
   116
#endif
sl@0
   117
sl@0
   118
/* configurable pathname variables */
sl@0
   119
#define	_PC_LINK_MAX		 1
sl@0
   120
#define	_PC_MAX_CANON		 2
sl@0
   121
#define	_PC_MAX_INPUT		 3
sl@0
   122
#define	_PC_NAME_MAX		 4
sl@0
   123
#define	_PC_PATH_MAX		 5
sl@0
   124
#define	_PC_PIPE_BUF		 6
sl@0
   125
#define	_PC_CHOWN_RESTRICTED	 7
sl@0
   126
#define	_PC_NO_TRUNC		 8
sl@0
   127
#define	_PC_VDISABLE		 9
sl@0
   128
sl@0
   129
/*
sl@0
   130
#if __POSIX_VISIBLE >= 199309
sl@0
   131
#define	_PC_ASYNC_IO		53
sl@0
   132
#define	_PC_PRIO_IO		54
sl@0
   133
#define	_PC_SYNC_IO		55
sl@0
   134
#endif
sl@0
   135
sl@0
   136
sl@0
   137
#if __POSIX_VISIBLE >= 200112
sl@0
   138
#define	_PC_ALLOC_SIZE_MIN	10
sl@0
   139
#define	_PC_FILESIZEBITS	12
sl@0
   140
#define	_PC_REC_INCR_XFER_SIZE	14
sl@0
   141
#define	_PC_REC_MAX_XFER_SIZE	15
sl@0
   142
#define	_PC_REC_MIN_XFER_SIZE	16
sl@0
   143
#define	_PC_REC_XFER_ALIGN	17
sl@0
   144
#define	_PC_SYMLINK_MAX		18
sl@0
   145
#endif
sl@0
   146
sl@0
   147
#if __BSD_VISIBLE
sl@0
   148
#define	_PC_ACL_EXTENDED	59
sl@0
   149
#define	_PC_ACL_PATH_MAX	60
sl@0
   150
#define	_PC_CAP_PRESENT		61
sl@0
   151
#define	_PC_INF_PRESENT		62
sl@0
   152
#define	_PC_MAC_PRESENT		63
sl@0
   153
#endif
sl@0
   154
*/
sl@0
   155
#if __BSD_VISIBLE
sl@0
   156
/*
sl@0
   157
 * rfork() options.
sl@0
   158
 *
sl@0
   159
 * XXX currently, some operations without RFPROC set are not supported.
sl@0
   160
 */
sl@0
   161
#define	RFNAMEG		(1<<0)	/* UNIMPL new plan9 `name space' */
sl@0
   162
#define	RFENVG		(1<<1)	/* UNIMPL copy plan9 `env space' */
sl@0
   163
#define	RFFDG		(1<<2)	/* copy fd table */
sl@0
   164
#define	RFNOTEG		(1<<3)	/* UNIMPL create new plan9 `note group' */
sl@0
   165
#define	RFPROC		(1<<4)	/* change child (else changes curproc) */
sl@0
   166
#define	RFMEM		(1<<5)	/* share `address space' */
sl@0
   167
#define	RFNOWAIT	(1<<6)	/* give child to init */
sl@0
   168
#define	RFCNAMEG	(1<<10)	/* UNIMPL zero plan9 `name space' */
sl@0
   169
#define	RFCENVG		(1<<11)	/* UNIMPL zero plan9 `env space' */
sl@0
   170
#define	RFCFDG		(1<<12)	/* close all fds, zero fd table */
sl@0
   171
#define	RFTHREAD	(1<<13)	/* enable kernel thread support */
sl@0
   172
#define	RFSIGSHARE	(1<<14)	/* share signal handlers */
sl@0
   173
#define	RFLINUXTHPN	(1<<16)	/* do linux clone exit parent notification */
sl@0
   174
#define	RFSTOPPED	(1<<17)	/* leave child in a stopped state */
sl@0
   175
#define	RFHIGHPID	(1<<18)	/* use a pid higher then 10 (idleproc) */
sl@0
   176
#define	RFPPWAIT	(1<<31)	/* parent sleeps until child exits (vfork) */
sl@0
   177
#define	RFKERNELONLY	(RFSTOPPED | RFHIGHPID | RFPPWAIT)
sl@0
   178
sl@0
   179
#endif /* __BSD_VISIBLE */
sl@0
   180
sl@0
   181
#endif /* !_SYS_UNISTD_H_ */