source: SVN/cambria/redboot/packages/isoinfra/current/include/unistd.h @ 1

Last change on this file since 1 was 1, checked in by Tim Harvey, 2 years ago

restored latest version of files from server backup

Signed-off-by: Tim Harvey <tharvey@…>

File size: 8.4 KB
Line 
1#ifndef CYGONCE_ISO_UNISTD_H
2#define CYGONCE_ISO_UNISTD_H
3/*========================================================================
4//
5//      unistd.h
6//
7//      POSIX UNIX standard definitions
8//
9//========================================================================
10//####ECOSGPLCOPYRIGHTBEGIN####
11// -------------------------------------------
12// This file is part of eCos, the Embedded Configurable Operating System.
13// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
14//
15// eCos is free software; you can redistribute it and/or modify it under
16// the terms of the GNU General Public License as published by the Free
17// Software Foundation; either version 2 or (at your option) any later version.
18//
19// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
20// WARRANTY; without even the implied warranty of MERCHANTABILITY or
21// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
22// for more details.
23//
24// You should have received a copy of the GNU General Public License along
25// with eCos; if not, write to the Free Software Foundation, Inc.,
26// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
27//
28// As a special exception, if other files instantiate templates or use macros
29// or inline functions from this file, or you compile this file and link it
30// with other works to produce a work based on this file, this file does not
31// by itself cause the resulting work to be covered by the GNU General Public
32// License. However the source code for this file must still be made available
33// in accordance with section (3) of the GNU General Public License.
34//
35// This exception does not invalidate any other reasons why a work based on
36// this file might be covered by the GNU General Public License.
37//
38// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
39// at http://sources.redhat.com/ecos/ecos-license/
40// -------------------------------------------
41//####ECOSGPLCOPYRIGHTEND####
42//========================================================================
43//#####DESCRIPTIONBEGIN####
44//
45// Author(s):     nickg
46// Contributors: 
47// Date:          2000-06-01
48// Purpose:       This file provides the macros, types and functions
49//                required by POSIX 1003.1.
50// Description:   Much of the real contents of this file get set from the
51//                configuration (set by the implementation)
52// Usage:         #include <unistd.h>
53//
54//####DESCRIPTIONEND####
55//
56//======================================================================
57*/
58
59/* CONFIGURATION */
60
61#include <pkgconf/isoinfra.h>          /* Configuration header */
62
63
64/* INCLUDES */
65
66#include <sys/types.h>
67
68/* This is the "standard" way to get NULL and size_t from stddef.h,
69 * which is the canonical location of the definitions.
70 */
71#define __need_NULL
72#define __need_size_t
73#include <stddef.h>
74
75
76#ifdef CYGINT_ISO_POSIX_TIMER_OPS
77# ifdef CYGBLD_ISO_POSIX_TIMER_OPS_HEADER
78#  include CYGBLD_ISO_POSIX_TIMER_OPS_HEADER
79# else
80
81#  ifdef __cplusplus
82extern "C" {
83#  endif
84
85extern unsigned int
86alarm( unsigned int /* seconds */ );
87
88extern int 
89pause( void );
90
91#  ifdef __cplusplus
92}   /* extern "C" */
93#  endif
94
95# endif
96#endif
97
98#ifdef CYGINT_ISO_POSIX_SLEEP
99# ifdef CYGBLD_ISO_POSIX_SLEEP_HEADER
100#  include CYGBLD_ISO_POSIX_SLEEP_HEADER
101# else
102#  ifdef __cplusplus
103extern "C" {
104#  endif
105
106unsigned int
107sleep( unsigned int /* seconds */ );
108
109#  ifdef __cplusplus
110}   /* extern "C" */
111#  endif
112# endif
113#endif
114
115
116/* ------------------------------------------------------------------- */
117
118/* FIXME: The below was copied in verbatim by Nick, but needs to be grouped
119   by functionality and linked with interfaces as with everything else
120*/
121
122/* CONSTANTS */
123
124/* Configuration constants */
125
126#define _POSIX_VERSION          199506L
127
128/* constants for access() */
129#define R_OK    1
130#define W_OK    2
131#define X_OK    4
132#define F_OK    8
133
134/* constants for lseek */
135#ifndef SEEK_SET
136#define SEEK_SET        0
137#define SEEK_CUR        1
138#define SEEK_END        2
139#endif
140
141#define STDIN_FILENO    0
142#define STDOUT_FILENO   1
143#define STDERR_FILENO   2
144
145/* Variable names for sysconf()                         */
146#define _SC_AIO_LISTIO_MAX               1
147#define _SC_AIO_MAX                      2
148#define _SC_AIO_PRIO_DELTA_MAX           3
149#define _SC_ARG_MAX                      4
150#define _SC_ASYNCHRONOUS_IO              5
151#define _SC_CHILD_MAX                    6
152#define _SC_CLK_TCK                      7
153#define _SC_DELAYTIMER_MAX               8
154#define _SC_FSYNC                        9
155#define _SC_GETGR_R_SIZE_MAX            10
156#define _SC_GETPW_R_SIZE_MAX            11
157#define _SC_JOB_CONTROL                 12
158#define _SC_LOGIN_NAME_MAX              13
159#define _SC_MAPPED_FILES                14
160#define _SC_MEMLOCK                     15
161#define _SC_MEMLOCK_RANGE               16
162#define _SC_MEMORY_PROTECTION           17
163#define _SC_MESSAGE_PASSING             18
164#define _SC_MQ_OPEN_MAX                 19
165#define _SC_MQ_PRIO_MAX                 20
166#define _SC_NGROUPS_MAX                 21
167#define _SC_OPEN_MAX                    22
168#define _SC_PAGESIZE                    23
169#define _SC_PRIORITIZED_IO              24
170#define _SC_PRIORITY_SCHEDULING         25
171#define _SC_REALTIME_SIGNALS            26
172#define _SC_RTSIG_MAX                   27
173#define _SC_SAVED_IDS                   28
174#define _SC_SEMAPHORES                  29
175#define _SC_SEM_NSEMS_MAX               30
176#define _SC_SEM_VALUE_MAX               31
177#define _SC_SHARED_MEMORY_OBJECTS       32
178#define _SC_SIGQUEUE_MAX                33
179#define _SC_STREAM_MAX                  34
180#define _SC_SYNCHRONIZED_IO             35
181#define _SC_THREADS                     36
182#define _SC_THREAD_ATTR_STACKADDR       37
183#define _SC_THREAD_ATTR_STACKSIZE       38
184#define _SC_THREAD_DESTRUCTOR_ITERATIONS 39
185#define _SC_THREAD_KEYS_MAX             40
186#define _SC_THREAD_PRIO_INHERIT         41
187#define _SC_THREAD_PRIO_PROTECT         42
188#define _SC_THREAD_PRIORITY_SCHEDULING  43
189#define _SC_THREAD_PROCESS_SHARED       44
190#define _SC_THREAD_SAFE_FUNCTIONS       45
191#define _SC_THREAD_STACK_MIN            46
192#define _SC_THREAD_THREADS_MAX          47
193#define _SC_TIMERS                      48
194#define _SC_TIMER_MAX                   49
195#define _SC_TTY_NAME_MAX                50
196#define _SC_TZNAME_MAX                  51
197#define _SC_VERSION                     52
198
199/* Variable names for pathconf()                        */
200#define _PC_ASYNC_IO                     1
201#define _PC_CHOWN_RESTRICTED             2
202#define _PC_LINK_MAX                     3
203#define _PC_MAX_CANON                    4
204#define _PC_MAX_INPUT                    5
205#define _PC_NAME_MAX                     6
206#define _PC_NO_TRUNC                     7
207#define _PC_PATH_MAX                     8
208#define _PC_PIPE_BUF                     9
209#define _PC_PRIO_IO                     10
210#define _PC_SYNC_IO                     11
211#define _PC_VDISABLE                    12
212
213
214/* Standard function prototypes */
215
216
217#ifdef __cplusplus
218extern "C" {
219#endif
220
221
222extern int      link(const char *path1, const char *path2);
223extern int      unlink(const char *path);
224extern int      rmdir(const char *path);
225extern int      access(const char *path, int amode);
226extern int      chown(const char *path, uid_t owner, uid_t group);
227extern long     pathconf(const char *path, int name);
228extern long     fpathconf(int fd, int name);
229extern int      pipe(int fildes[2]);
230extern int      dup(int fd);
231extern int      dup2(int fd,int fd2);
232extern int      close(int fd);
233extern ssize_t  read(int fd, void *buf, size_t nbyte);
234extern ssize_t  write(int fd, const void *buf, size_t nbyte);
235extern off_t    lseek(int fd, off_t offset, int whence);
236extern int      fsync( int fd );
237extern int      ftruncate(int fd, off_t length);
238
239extern int      chdir(const char *path);
240extern char     *getcwd(char *buf, size_t size);
241
242extern pid_t    getpid(void);
243extern pid_t    getppid(void);
244extern uid_t    getuid(void);
245extern uid_t    geteuid(void);
246extern uid_t    getgid(void);
247extern uid_t    getegid(void);
248extern int      setuid(uid_t uid);
249extern int      setgid(uid_t uid);
250extern int      getgroups(int setsize, uid_t *list);
251extern char     *getlogin(void);
252extern char     *cuserid(char *s);
253extern pid_t    getpgrp(void);
254extern pid_t    setsid(void);
255extern int      setpgid(pid_t pid, pid_t pgid);
256extern char     *getenv(const char *name);
257extern char     *ctermid(char *s);
258extern char     *ttyname(int fd);
259extern int      isatty(int fd);
260extern long     sysconf(int name);
261
262extern int      vfork(void);
263extern int      execl(char *path,...);
264extern int      execv(char *path,char **argv);
265extern int      execle(char *path,...);
266extern int      execlp(char *file,...);
267extern int      execvp(char *file, char **argv);
268extern int      execve(char *name, char **argv, char **envv);
269extern void     _exit(int code);
270
271#ifdef __cplusplus
272}   /* extern "C" */
273#endif
274
275#endif /* CYGONCE_ISO_UNISTD_H multiple inclusion protection */
276
277/* EOF unistd.h */
Note: See TracBrowser for help on using the repository browser.