1 #ifndef _UNISTD_H
2 #define _UNISTD_H
3
4
5 #define _POSIX_VERSION 198808L
6
7 #define _POSIX_CHOWN_RESTRICTED 1
8 #define _POSIX_NO_TRUNC 1
9 #define _POSIX_VDISABLE '\0'
10 #define _POSIX_JOB_CONTROL 1
11 #define _POSIX_SAVED_IDS 1
12
13 #define STDIN_FILENO 0
14 #define STDOUT_FILENO 1
15 #define STDERR_FILENO 2
16
17 #ifndef NULL
18 #define NULL ((void *)0)
19 #endif
20
21
22 #define F_OK 0
23 #define X_OK 1
24 #define W_OK 2
25 #define R_OK 4
26
27
28 #define SEEK_SET 0
29 #define SEEK_CUR 1
30 #define SEEK_END 2
31
32
33 #define _SC_ARG_MAX 1
34 #define _SC_CHILD_MAX 2
35 #define _SC_CLOCKS_PER_SEC 3
36 #define _SC_NGROUPS_MAX 4
37 #define _SC_OPEN_MAX 5
38 #define _SC_JOB_CONTROL 6
39 #define _SC_SAVED_IDS 7
40 #define _SC_VERSION 8
41
42
43 #define _PC_LINK_MAX 1
44 #define _PC_MAX_CANON 2
45 #define _PC_MAX_INPUT 3
46 #define _PC_NAME_MAX 4
47 #define _PC_PATH_MAX 5
48 #define _PC_PIPE_BUF 6
49 #define _PC_NO_TRUNC 7
50 #define _PC_VDISABLE 8
51 #define _PC_CHOWN_RESTRICTED 9
52
53 #if 0
54
55
56
57 #include <sys/types.h>
58 #endif
59 #include <sys/stat.h>
60 #include <sys/time.h>
61 #include <sys/times.h>
62 #include <sys/utsname.h>
63 #include <sys/resource.h>
64 #include <utime.h>
65
66 #ifdef __LIBRARY__
67 #include <linux/unistd.h>
68 #endif
69
70
71 extern int errno;
72
73
74
75
76
77
78 int access(const char * filename, mode_t mode);
79 int acct(const char * filename);
80 int brk(void * end_data_segment);
81
82 int alarm(int sec);
83 void * sbrk(ptrdiff_t increment);
84 int chdir(const char * filename);
85 int chmod(const char * filename, mode_t mode);
86 int chown(const char * filename, uid_t owner, gid_t group);
87 int chroot(const char * filename);
88 int close(int fildes);
89 int creat(const char * filename, mode_t mode);
90 int dup(int fildes);
91 int execve(const char * filename, char ** argv, char ** envp);
92 int execv(const char * pathname, char ** argv);
93 int execvp(const char * file, char ** argv);
94 int execl(const char * pathname, char * arg0, ...);
95 int execlp(const char * file, char * arg0, ...);
96 int execle(const char * pathname, char * arg0, ...);
97 volatile void exit(int status);
98 volatile void _exit(int status);
99 int fcntl(int fildes, int cmd, ...);
100 pid_t fork(void);
101 pid_t getpid(void);
102 uid_t getuid(void);
103 uid_t geteuid(void);
104 gid_t getgid(void);
105 gid_t getegid(void);
106 int ioctl(int fildes, int cmd, ...);
107 int kill(pid_t pid, int signal);
108 int link(const char * filename1, const char * filename2);
109 off_t lseek(int fildes, off_t offset, int origin);
110 int mknod(const char * filename, mode_t mode, dev_t dev);
111 int mount(const char * specialfile, const char * dir, const char * type, int rwflag);
112 int nice(int val);
113 int open(const char * filename, int flag, ...);
114 int pause(void);
115 int pipe(int * fildes);
116
117 int read(int fildes, char * buf, off_t count);
118 int setpgrp(void);
119 int setpgid(pid_t pid,pid_t pgid);
120 int setuid(uid_t uid);
121 int setgid(gid_t gid);
122 void (*signal(int sig, void (*fn)(int)))(int);
123 int stat(const char * filename, struct stat * stat_buf);
124 int fstat(int fildes, struct stat * stat_buf);
125 int stime(time_t * tptr);
126 int sync(void);
127 time_t time(time_t * tloc);
128 time_t times(struct tms * tbuf);
129 int ulimit(int cmd, long limit);
130 mode_t umask(mode_t mask);
131 int umount(const char * specialfile);
132 int uname(struct utsname * name);
133 int unlink(const char * filename);
134 int ustat(dev_t dev, struct ustat * ubuf);
135 int utime(const char * filename, struct utimbuf * times);
136 pid_t waitpid(pid_t pid,int * wait_stat,int options);
137 pid_t wait(int * wait_stat);
138
139 int write(int fildes, const char * buf, off_t count);
140 int dup2(int oldfd, int newfd);
141 int getppid(void);
142 pid_t getpgrp(void);
143 pid_t setsid(void);
144 int sethostname(char *name, int len);
145 int setrlimit(int resource, struct rlimit *rlp);
146 int getrlimit(int resource, struct rlimit *rlp);
147 int getrusage(int who, struct rusage *rusage);
148 int gettimeofday(struct timeval *tv, struct timezone *tz);
149 int settimeofday(struct timeval *tv, struct timezone *tz);
150 int getgroups(int gidsetlen, gid_t *gidset);
151 int setgroups(int gidsetlen, gid_t *gidset);
152 int select(int width, fd_set * readfds, fd_set * writefds,
153 fd_set * exceptfds, struct timeval * timeout);
154 int swapon(const char * specialfile);
155 #endif