1 |
148 |
jeremybenn |
#ifndef _UNISTD_H
|
2 |
|
|
#define _UNISTD_H
|
3 |
|
|
|
4 |
|
|
#include <features.h>
|
5 |
|
|
|
6 |
|
|
#ifdef __cplusplus
|
7 |
|
|
extern "C" {
|
8 |
|
|
#endif
|
9 |
|
|
|
10 |
|
|
#include <_ansi.h>
|
11 |
|
|
#include <sys/types.h>
|
12 |
|
|
#include <sys/_types.h>
|
13 |
|
|
#define __need_size_t
|
14 |
|
|
#define __need_ptrdiff_t
|
15 |
|
|
#include <stddef.h>
|
16 |
|
|
|
17 |
|
|
extern char **environ;
|
18 |
|
|
|
19 |
|
|
void _EXFUN(_exit, (int __status ) _ATTRIBUTE ((noreturn)));
|
20 |
|
|
|
21 |
|
|
int _EXFUN(access,(const char *__path, int __amode ));
|
22 |
|
|
unsigned _EXFUN(alarm, (unsigned __secs ));
|
23 |
|
|
int _EXFUN(chdir, (const char *__path ));
|
24 |
|
|
int _EXFUN(chmod, (const char *__path, mode_t __mode ));
|
25 |
|
|
int _EXFUN(chown, (const char *__path, uid_t __owner, gid_t __group ));
|
26 |
|
|
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(fchdir, (int __fildes));
|
39 |
|
|
int _EXFUN(fchmod, (int __fildes, mode_t __mode ));
|
40 |
|
|
int _EXFUN(fchown, (int __fildes, uid_t __owner, gid_t __group ));
|
41 |
|
|
pid_t _EXFUN(fork, (void ));
|
42 |
|
|
long _EXFUN(fpathconf, (int __fd, int __name ));
|
43 |
|
|
int _EXFUN(fsync, (int __fd));
|
44 |
|
|
int _EXFUN(ftruncate, (int __fd, off_t __length));
|
45 |
|
|
char _EXFUN(*getcwd, (char *__buf, size_t __size ));
|
46 |
|
|
int _EXFUN(getdomainname ,(char *__name, size_t __len));
|
47 |
|
|
gid_t _EXFUN(getegid, (void ));
|
48 |
|
|
uid_t _EXFUN(geteuid, (void ));
|
49 |
|
|
gid_t _EXFUN(getgid, (void ));
|
50 |
|
|
int _EXFUN(getgroups, (int __gidsetsize, gid_t __grouplist[] ));
|
51 |
|
|
int _EXFUN(__gethostname, (char *__name, size_t __len));
|
52 |
|
|
char _EXFUN(*getlogin, (void ));
|
53 |
|
|
#if defined(_POSIX_THREAD_SAFE_FUNCTIONS)
|
54 |
|
|
int _EXFUN(getlogin_r, (char *name, size_t namesize) );
|
55 |
|
|
#endif
|
56 |
|
|
char _EXFUN(*getpass, (__const char *__prompt));
|
57 |
|
|
size_t _EXFUN(getpagesize, (void));
|
58 |
|
|
pid_t _EXFUN(getpgid, (pid_t));
|
59 |
|
|
pid_t _EXFUN(getpgrp, (void ));
|
60 |
|
|
pid_t _EXFUN(getpid, (void ));
|
61 |
|
|
pid_t _EXFUN(getppid, (void ));
|
62 |
|
|
uid_t _EXFUN(getuid, (void ));
|
63 |
|
|
char * _EXFUN(getusershell, (void));
|
64 |
|
|
char _EXFUN(*getwd, (char *__buf ));
|
65 |
|
|
int _EXFUN(isatty, (int __fildes ));
|
66 |
|
|
int _EXFUN(lchown, (const char *__path, uid_t __owner, gid_t __group ));
|
67 |
|
|
int _EXFUN(link, (const char *__path1, const char *__path2 ));
|
68 |
|
|
int _EXFUN(nice, (int __nice_value ));
|
69 |
|
|
off_t _EXFUN(lseek, (int __fildes, off_t __offset, int __whence ));
|
70 |
|
|
long _EXFUN(pathconf, (const char *__path, int __name ));
|
71 |
|
|
int _EXFUN(pause, (void ));
|
72 |
|
|
int _EXFUN(pipe, (int __fildes[2] ));
|
73 |
|
|
ssize_t _EXFUN(pread, (int __fd, void *__buf, size_t __nbytes, off_t __offset));
|
74 |
|
|
ssize_t _EXFUN(pwrite, (int __fd, const void *__buf, size_t __nbytes, off_t __offset));
|
75 |
|
|
_READ_WRITE_RETURN_TYPE _EXFUN(read, (int __fd, void *__buf, size_t __nbyte ));
|
76 |
|
|
int _EXFUN(readlink, (const char *path, char *buf, size_t bufsiz));
|
77 |
|
|
int _EXFUN(rmdir, (const char *__path ));
|
78 |
|
|
void * _EXFUN(sbrk, (ptrdiff_t __incr));
|
79 |
|
|
int _EXFUN(setegid, (gid_t __gid ));
|
80 |
|
|
int _EXFUN(seteuid, (uid_t __uid ));
|
81 |
|
|
int _EXFUN(setgid, (gid_t __gid ));
|
82 |
|
|
int _EXFUN(setpgid, (pid_t __pid, pid_t __pgid ));
|
83 |
|
|
int _EXFUN(setpgrp, (void ));
|
84 |
|
|
pid_t _EXFUN(setsid, (void ));
|
85 |
|
|
int _EXFUN(setuid, (uid_t __uid ));
|
86 |
|
|
unsigned _EXFUN(sleep, (unsigned int __seconds ));
|
87 |
|
|
void _EXFUN(swab, (const void *, void *, ssize_t));
|
88 |
|
|
int _EXFUN(symlink, (const char *oldpath, const char *newpath));
|
89 |
|
|
long _EXFUN(sysconf, (int __name ));
|
90 |
|
|
pid_t _EXFUN(tcgetpgrp, (int __fildes ));
|
91 |
|
|
int _EXFUN(tcsetpgrp, (int __fildes, pid_t __pgrp_id ));
|
92 |
|
|
int _EXFUN(truncate, (const char *, off_t __length));
|
93 |
|
|
char * _EXFUN(ttyname, (int __fildes ));
|
94 |
|
|
int _EXFUN(ttyname_r, (int __fildes, char *__buf, size_t __len));
|
95 |
|
|
int _EXFUN(unlink, (const char *__path ));
|
96 |
|
|
int _EXFUN(usleep, (__useconds_t __useconds));
|
97 |
|
|
int _EXFUN(vhangup, (void ));
|
98 |
|
|
_READ_WRITE_RETURN_TYPE _EXFUN(write, (int __fd, const void *__buf, size_t __nbyte ));
|
99 |
|
|
|
100 |
|
|
extern char *optarg; /* getopt(3) external variables */
|
101 |
|
|
extern int optind, opterr, optopt;
|
102 |
|
|
int getopt(int, char * const [], const char *);
|
103 |
|
|
extern int optreset; /* getopt(3) external variable */
|
104 |
|
|
|
105 |
|
|
#ifndef _POSIX_SOURCE
|
106 |
|
|
pid_t _EXFUN(vfork, (void ));
|
107 |
|
|
|
108 |
|
|
extern char *suboptarg; /* getsubopt(3) external variable */
|
109 |
|
|
int getsubopt(char **, char * const *, char **);
|
110 |
|
|
#endif /* _POSIX_SOURCE */
|
111 |
|
|
|
112 |
|
|
/* Provide prototypes for most of the _<systemcall> names that are
|
113 |
|
|
provided in newlib for some compilers. */
|
114 |
|
|
int _EXFUN(_close, (int __fildes ));
|
115 |
|
|
pid_t _EXFUN(_fork, (void ));
|
116 |
|
|
pid_t _EXFUN(_getpid, (void ));
|
117 |
|
|
int _EXFUN(_link, (const char *__path1, const char *__path2 ));
|
118 |
|
|
off_t _EXFUN(_lseek, (int __fildes, off_t __offset, int __whence ));
|
119 |
|
|
_READ_WRITE_RETURN_TYPE _EXFUN(_read, (int __fd, void *__buf, size_t __nbyte ));
|
120 |
|
|
void * _EXFUN(_sbrk, (size_t __incr));
|
121 |
|
|
int _EXFUN(_unlink, (const char *__path ));
|
122 |
|
|
_READ_WRITE_RETURN_TYPE _EXFUN(_write, (int __fd, const void *__buf, size_t __nbyte ));
|
123 |
|
|
int _EXFUN(_execve, (const char *__path, char * const __argv[], char * const __envp[] ));
|
124 |
|
|
|
125 |
|
|
#define F_OK 0
|
126 |
|
|
#define R_OK 4
|
127 |
|
|
#define W_OK 2
|
128 |
|
|
#define X_OK 1
|
129 |
|
|
|
130 |
|
|
# define SEEK_SET 0
|
131 |
|
|
# define SEEK_CUR 1
|
132 |
|
|
# define SEEK_END 2
|
133 |
|
|
|
134 |
|
|
#include <sys/features.h>
|
135 |
|
|
|
136 |
|
|
#define STDIN_FILENO 0 /* standard input file descriptor */
|
137 |
|
|
#define STDOUT_FILENO 1 /* standard output file descriptor */
|
138 |
|
|
#define STDERR_FILENO 2 /* standard error file descriptor */
|
139 |
|
|
|
140 |
|
|
#include <bits/environments.h>
|
141 |
|
|
#include <bits/confname.h>
|
142 |
|
|
|
143 |
|
|
# define MAXPATHLEN 1024
|
144 |
|
|
|
145 |
|
|
#ifdef __cplusplus
|
146 |
|
|
}
|
147 |
|
|
#endif
|
148 |
|
|
#endif /* _SYS_UNISTD_H */
|