blob: 274e29f0963d17f2a9d66e4f399cf955e3c1a096 [file] [log] [blame]
Vishal Bhoj82c80712015-12-15 21:13:33 +05301/** @file
2
3 Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials are licensed and made available under
5 the terms and conditions of the BSD License that accompanies this distribution.
6 The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 * Copyright (c) 1989, 1993
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. Neither the name of the University nor the names of its contributors
24 * may be used to endorse or promote products derived from this software
25 * without specific prior written permission.
26 *
27 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
28 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
31 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 *
39 * @(#)unistd.h 8.2 (Berkeley) 1/7/94
40 NetBSD: unistd.h,v 1.35 2006/08/14 18:17:48 rpaulo Exp
41**/
42#ifndef _SYS_UNISTD_H_
43#define _SYS_UNISTD_H_
44
45#include <sys/featuretest.h>
46
47/* compile-time symbolic constants */
48
49/*
50 * According to POSIX 1003.1:
51 * "The saved set-user-ID capability allows a program to regain the
52 * effective user ID established at the last exec call."
53 * However, the setuid/setgid function as specified by POSIX 1003.1 does
54 * not allow changing the effective ID from the super-user without also
55 * changed the saved ID, so it is impossible to get super-user privileges
56 * back later. Instead we provide this feature independent of the current
57 * effective ID through the seteuid/setegid function. In addition, we do
58 * not use the saved ID as specified by POSIX 1003.1 in setuid/setgid,
59 * because this would make it impossible for a set-user-ID executable
60 * owned by a user other than the super-user to permanently revoke its
61 * extra privileges.
62 */
63#ifdef _NOT_AVAILABLE
64#define _POSIX_SAVED_IDS /* saved set-user-ID and set-group-ID */
65#endif
66
67#define _POSIX_VERSION 199009L
68#define _POSIX2_VERSION 199212L
69
70/* execution-time symbolic constants */
71 /* timers */
72#define _POSIX_TIMERS 200112L
73
74/* Always ensure that these are consistent with <fcntl.h>!
75 whence values for lseek(2).
76*/
77#ifndef SEEK_SET
78#define SEEK_SET 0 /**< set file offset to offset */
79#endif
80#ifndef SEEK_CUR
81#define SEEK_CUR 1 /**< set file offset to current plus offset */
82#endif
83#ifndef SEEK_END
84#define SEEK_END 2 /**< set file offset to EOF plus offset */
85#endif
86
87/* whence values for lseek(2); renamed by POSIX 1003.1 */
88#define L_SET SEEK_SET
89#define L_INCR SEEK_CUR
90#define L_XTND SEEK_END
91
92/* configurable system strings */
93#define _CS_PATH 1
94
95#endif /* !_SYS_UNISTD_H_ */