10 #include <sys/_types.h>
12 #define __need_ptrdiff_t
15 extern char **environ
;
17 void _EXFUN(_exit
, (int __status
) _ATTRIBUTE ((noreturn
)));
19 int _EXFUN(access
,(const char *__path
, int __amode
));
20 unsigned _EXFUN(alarm
, (unsigned __secs
));
21 int _EXFUN(chdir
, (const char *__path
));
22 int _EXFUN(chmod
, (const char *__path
, mode_t __mode
));
23 int _EXFUN(chown
, (const char *__path
, uid_t __owner
, gid_t __group
));
24 #if defined (__CYGWIN__) || defined(__rtems__) || defined (__MSYS__)
25 int _EXFUN(chroot
, (const char *__path
));
27 int _EXFUN(close
, (int __fildes
));
28 char _EXFUN(*ctermid
, (char *__s
));
29 char _EXFUN(*cuserid
, (char *__s
));
30 int _EXFUN(dup
, (int __fildes
));
31 int _EXFUN(dup2
, (int __fildes
, int __fildes2
));
32 int _EXFUN(execl
, (const char *__path
, const char *, ... ));
33 int _EXFUN(execle
, (const char *__path
, const char *, ... ));
34 int _EXFUN(execlp
, (const char *__file
, const char *, ... ));
35 int _EXFUN(execv
, (const char *__path
, char * const __argv
[] ));
36 int _EXFUN(execve
, (const char *__path
, char * const __argv
[], char * const __envp
[] ));
37 int _EXFUN(execvp
, (const char *__file
, char * const __argv
[] ));
38 int _EXFUN(fchmod
, (int __fildes
, mode_t __mode
));
39 int _EXFUN(fchown
, (int __fildes
, uid_t __owner
, gid_t __group
));
40 pid_t
_EXFUN(fork
, (void ));
41 long _EXFUN(fpathconf
, (int __fd
, int __name
));
42 int _EXFUN(fsync
, (int __fd
));
43 char _EXFUN(*getcwd
, (char *__buf
, size_t __size
));
44 gid_t
_EXFUN(getegid
, (void ));
45 uid_t
_EXFUN(geteuid
, (void ));
46 gid_t
_EXFUN(getgid
, (void ));
47 int _EXFUN(getgroups
, (int __gidsetsize
, gid_t __grouplist
[] ));
48 char _EXFUN(*getlogin
, (void ));
49 #if defined(_POSIX_THREAD_SAFE_FUNCTIONS)
50 int _EXFUN(getlogin_r
, (char *name
, size_t namesize
) );
52 char _EXFUN(*getpass
, (__const
char *__prompt
));
53 size_t _EXFUN(getpagesize
, (void));
54 pid_t
_EXFUN(getpgid
, (pid_t
));
55 pid_t
_EXFUN(getpgrp
, (void ));
56 pid_t
_EXFUN(getpid
, (void ));
57 pid_t
_EXFUN(getppid
, (void ));
58 uid_t
_EXFUN(getuid
, (void ));
59 #if defined (__CYGWIN__) || defined (__MSYS__)
60 char _EXFUN(*getwd
, (char *__buf
));
62 int _EXFUN(isatty
, (int __fildes
));
63 int _EXFUN(lchown
, (const char *__path
, uid_t __owner
, gid_t __group
));
64 int _EXFUN(link
, (const char *__path1
, const char *__path2
));
65 int _EXFUN(nice
, (int __nice_value
));
66 off_t
_EXFUN(lseek
, (int __fildes
, off_t __offset
, int __whence
));
67 long _EXFUN(pathconf
, (const char *__path
, int __name
));
68 int _EXFUN(pause
, (void ));
69 #if defined (__CYGWIN__) || defined (__MSYS__)
70 int _EXFUN(pthread_atfork
, (void (*)(void), void (*)(void), void (*)(void)));
72 int _EXFUN(pipe
, (int __fildes
[2] ));
73 _READ_WRITE_RETURN_TYPE
_EXFUN(read
, (int __fd
, void *__buf
, size_t __nbyte
));
74 int _EXFUN(rmdir
, (const char *__path
));
75 #if defined(__rtems__)
76 void * _EXFUN(sbrk
, (ptrdiff_t __incr
));
78 void * _EXFUN(sbrk
, (size_t __incr
));
80 #if defined(__CYGWIN__) || defined(__MSYS__)
81 int _EXFUN(setegid
, (gid_t __gid
));
82 int _EXFUN(seteuid
, (uid_t __uid
));
84 int _EXFUN(setgid
, (gid_t __gid
));
85 int _EXFUN(setpgid
, (pid_t __pid
, pid_t __pgid
));
86 int _EXFUN(setpgrp
, (void ));
87 pid_t
_EXFUN(setsid
, (void ));
88 int _EXFUN(setuid
, (uid_t __uid
));
89 unsigned _EXFUN(sleep
, (unsigned int __seconds
));
90 void _EXFUN(swab
, (const void *, void *, ssize_t
));
91 long _EXFUN(sysconf
, (int __name
));
92 pid_t
_EXFUN(tcgetpgrp
, (int __fildes
));
93 int _EXFUN(tcsetpgrp
, (int __fildes
, pid_t __pgrp_id
));
94 char _EXFUN(*ttyname
, (int __fildes
));
95 int _EXFUN(unlink
, (const char *__path
));
96 int _EXFUN(vhangup
, (void ));
97 _READ_WRITE_RETURN_TYPE
_EXFUN(write
, (int __fd
, const void *__buf
, size_t __nbyte
));
100 pid_t
_EXFUN(vfork
, (void ));
101 #endif /* _POSIX_SOURCE */
103 /* Provide prototypes for most of the _<systemcall> names that are
104 provided in newlib for some compilers. */
105 int _EXFUN(_close
, (int __fildes
));
106 pid_t
_EXFUN(_fork
, (void ));
107 pid_t
_EXFUN(_getpid
, (void ));
108 int _EXFUN(_link
, (const char *__path1
, const char *__path2
));
109 off_t
_EXFUN(_lseek
, (int __fildes
, off_t __offset
, int __whence
));
110 _READ_WRITE_RETURN_TYPE
_EXFUN(_read
, (int __fd
, void *__buf
, size_t __nbyte
));
111 void * _EXFUN(_sbrk
, (size_t __incr
));
112 int _EXFUN(_unlink
, (const char *__path
));
113 _READ_WRITE_RETURN_TYPE
_EXFUN(_write
, (int __fd
, const void *__buf
, size_t __nbyte
));
114 int _EXFUN(_execve
, (const char *__path
, char * const __argv
[], char * const __envp
[] ));
116 #if defined(__CYGWIN__) || defined(__rtems__) || defined(__MSYS__)
117 int _EXFUN(getdtablesize
, (void));
118 int _EXFUN(setdtablesize
, (int));
119 unsigned _EXFUN(usleep
, (unsigned int __useconds
));
120 int _EXFUN(ftruncate
, (int __fd
, off_t __length
));
121 int _EXFUN(truncate
, (const char *, off_t __length
));
122 #if !(defined (_WINSOCK_H) || defined (__USE_W32_SOCKETS))
123 /* winsock[2].h defines as __stdcall, and with int as 2nd arg */
124 int _EXFUN(gethostname
, (char *__name
, size_t __len
));
126 char * _EXFUN(mktemp
, (char *));
127 int _EXFUN(sync
, (void));
128 int _EXFUN(readlink
, (const char *__path
, char *__buf
, int __buflen
));
129 int _EXFUN(symlink
, (const char *__name1
, const char *__name2
));
141 #include <sys/features.h>
143 #define STDIN_FILENO 0 /* standard input file descriptor */
144 #define STDOUT_FILENO 1 /* standard output file descriptor */
145 #define STDERR_FILENO 2 /* standard error file descriptor */
148 * 4.8.1 Get Configurable System Variables, P1003.1b-1993, p. 96
150 * NOTE: Table 4-2, Configurable System Variables, p. 96
153 #define _SC_ARG_MAX 0
154 #define _SC_CHILD_MAX 1
155 #define _SC_CLK_TCK 2
156 #define _SC_NGROUPS_MAX 3
157 #define _SC_OPEN_MAX 4
158 /* no _SC_STREAM_MAX */
159 #define _SC_JOB_CONTROL 5
160 #define _SC_SAVED_IDS 6
161 #define _SC_VERSION 7
162 #define _SC_PAGESIZE 8
163 /* CYGWIN and MSYS-specific values .. do not touch */
164 #define _SC_NPROCESSORS_CONF 9
165 #define _SC_NPROCESSORS_ONLN 10
166 #define _SC_PHYS_PAGES 11
167 #define _SC_AVPHYS_PAGES 12
168 /* end of CYGWIN and MSYS-specific values */
169 #define _SC_MQ_OPEN_MAX 13
170 #define _SC_MQ_PRIO_MAX 14
171 #define _SC_RTSIG_MAX 15
172 #define _SC_SEM_NSEMS_MAX 16
173 #define _SC_SEM_VALUE_MAX 17
174 #define _SC_SIGQUEUE_MAX 18
175 #define _SC_TIMER_MAX 19
176 #define _SC_TZNAME_MAX 20
178 #define _SC_ASYNCHRONOUS_IO 21
180 #define _SC_MAPPED_FILES 23
181 #define _SC_MEMLOCK 24
182 #define _SC_MEMLOCK_RANGE 25
183 #define _SC_MEMORY_PROTECTION 26
184 #define _SC_MESSAGE_PASSING 27
185 #define _SC_PRIORITIZED_IO 28
186 #define _SC_REALTIME_SIGNALS 29
187 #define _SC_SEMAPHORES 30
188 #define _SC_SHARED_MEMORY_OBJECTS 31
189 #define _SC_SYNCHRONIZED_IO 32
190 #define _SC_TIMERS 33
191 #define _SC_AIO_LISTIO_MAX 34
192 #define _SC_AIO_MAX 35
193 #define _SC_AIO_PRIO_DELTA_MAX 36
194 #define _SC_DELAYTIMER_MAX 37
197 * P1003.1c/D10, p. 52 adds the following.
200 #define _SC_THREAD_KEYS_MAX 38
201 #define _SC_THREAD_STACK_MIN 39
202 #define _SC_THREAD_THREADS_MAX 40
203 #define _SC_TTY_NAME_MAX 41
205 #define _SC_THREADS 42
206 #define _SC_THREAD_ATTR_STACKADDR 43
207 #define _SC_THREAD_ATTR_STACKSIZE 44
208 #define _SC_THREAD_PRIORITY_SCHEDULING 45
209 #define _SC_THREAD_PRIO_INHERIT 46
210 /* _SC_THREAD_PRIO_PROTECT was _SC_THREAD_PRIO_CEILING in early drafts */
211 #define _SC_THREAD_PRIO_PROTECT 47
212 #define _SC_THREAD_PRIO_CEILING _SC_THREAD_PRIO_PROTECT
213 #define _SC_THREAD_PROCESS_SHARED 48
214 #define _SC_THREAD_SAFE_FUNCTIONS 49
215 #define _SC_GETGR_R_SIZE_MAX 50
216 #define _SC_GETPW_R_SIZE_MAX 51
217 #define _SC_LOGIN_NAME_MAX 52
218 #define _SC_THREAD_DESTRUCTOR_ITERATIONS 53
220 # define _PC_LINK_MAX 0
221 # define _PC_MAX_CANON 1
222 # define _PC_MAX_INPUT 2
223 # define _PC_NAME_MAX 3
224 # define _PC_PATH_MAX 4
225 # define _PC_PIPE_BUF 5
226 # define _PC_CHOWN_RESTRICTED 6
227 # define _PC_NO_TRUNC 7
228 # define _PC_VDISABLE 8
229 # define _PC_ASYNC_IO 9
230 # define _PC_PRIO_IO 10
231 # define _PC_SYNC_IO 11
232 #if defined(__CYGWIN__) || defined(__MSYS__)
233 /* Ask for POSIX permission bits support. */
234 # define _PC_POSIX_PERMISSIONS 90
235 /* Ask for full POSIX permission support including uid/gid settings. */
236 # define _PC_POSIX_SECURITY 91
239 /* FIXME: This is temporary until winsup gets sorted out. */
240 #if defined(__CYGWIN__) || defined(__MSYS__)
241 #define MAXPATHLEN (260 - 1 /* NUL */)
243 # define MAXPATHLEN 1024
249 #endif /* _SYS_UNISTD_H */