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