1:
2:
3:
4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33:
34:
35: #ifndef _UNISTD_H_
36: #define _UNISTD_H_
37:
38: #include <sys/cdefs.h>
39: #include <sys/types.h>
40: #include <sys/unistd.h>
41:
42: #define STDIN_FILENO 0
43: #define STDOUT_FILENO 1
44: #define STDERR_FILENO 2
45:
46: #if __XPG_VISIBLE || __POSIX_VISIBLE >= 200112
47: #define F_ULOCK 0
48: #define F_LOCK 1
49: #define F_TLOCK 2
50: #define F_TEST 3
51: #endif
52:
53: #if __POSIX_VISIBLE
54: #define _POSIX_REENTRANT_FUNCTIONS 1
55: #define _POSIX_THREAD_SAFE_FUNCTIONS 200112L
56: #endif
57:
58: #ifndef NULL
59: #ifdef __GNUG__
60: #define NULL __null
61: #elif defined(__cplusplus)
62: #define NULL 0L
63: #else
64: #define NULL ((void *)0)
65: #endif
66: #endif
67:
68: __BEGIN_DECLS
69: __dead void _exit(int);
70: int access(const char *, int);
71: unsigned int alarm(unsigned int);
72: int chdir(const char *);
73: int chown(const char *, uid_t, gid_t);
74: int __libc_close(int);
75: int dup(int);
76: int dup2(int, int);
77: int execl(const char *, const char *, ...)
78: ;
79: int execle(const char *, const char *, ...);
80: int execlp(const char *, const char *, ...)
81: ;
82: int execv(const char *, char *const *);
83: int execve(const char *, char *const *, char *const *);
84: int execvp(const char *, char *const *);
85: #if __BSD_VISIBLE
86: int execvpe(const char *, char *const *, char *const *);
87: #endif
88: pid_t fork(void);
89: long fpathconf(int, int);
90: int __libc_getcwd(char *, size_t)
91: ;
92: gid_t getegid(void);
93: uid_t geteuid(void);
94: gid_t getgid(void);
95: int getgroups(int, gid_t *);
96: char *getlogin(void);
97: pid_t getpgrp(void);
98: pid_t getpid(void);
99: pid_t getppid(void);
100: uid_t getuid(void);
101: int isatty(int);
102: int link(const char *, const char *);
103: off_t __libc_lseek(int, off_t, int);
104: long pathconf(const char *, int);
105: int pause(void);
106: int pipe(int *);
107: ssize_t __libc_read(int, void *, size_t)
108: ;
109: int rmdir(const char *);
110: int setgid(gid_t);
111: int setuid(uid_t);
112: unsigned int sleep(unsigned int);
113: long sysconf(int);
114: pid_t tcgetpgrp(int);
115: int tcsetpgrp(int, pid_t);
116: char *ttyname(int);
117: int unlink(const char *);
118: ssize_t __libc_write(int, const void *, size_t)
119: ;
120:
121: #if __POSIX_VISIBLE || __XPG_VISIBLE >= 300
122: pid_t setsid(void);
123: int setpgid(pid_t, pid_t);
124: #endif
125:
126: #if __POSIX_VISIBLE >= 199209 || __XPG_VISIBLE
127: size_t confstr(int, char *, size_t)
128: ;
129: #ifndef _GETOPT_DEFINED_
130: #define _GETOPT_DEFINED_
131: int getopt(int, char * const *, const char *);
132: extern char *optarg;
133: extern int opterr, optind, optopt, optreset;
134:
135: int getsubopt(char **, char * const *, char **);
136: extern char *suboptarg;
137: #endif
138: #endif
139:
140: #if __POSIX_VISIBLE >= 199506 || __XPG_VISIBLE
141: int fsync(int);
142: int ftruncate(int, off_t);
143: int getlogin_r(char *, size_t)
144: ;
145: #endif
146:
147: #if __XPG_VISIBLE || __BSD_VISIBLE
148: char *crypt(const char *, const char *);
149: int encrypt(char *, int);
150: int fchdir(int);
151: int fchown(int, uid_t, gid_t);
152: long gethostid(void);
153: char *getwd(char *)
154: ;
155: int lchown(const char *, uid_t, gid_t);
156: int mkstemp(char *);
157: char *mktemp(char *);
158: int nice(int);
159: int readlink(const char *, char *, size_t)
160: ;
161: int setkey(const char *);
162: int setpgrp(pid_t pid, pid_t pgrp);
163: int setregid(gid_t, gid_t);
164: int setreuid(uid_t, uid_t);
165: void swab(const void *, void *, size_t);
166: void sync(void);
167: int truncate(const char *, off_t);
168: unsigned int ualarm(unsigned int, unsigned int);
169: int usleep(useconds_t);
170: pid_t vfork(void);
171: #endif
172:
173: #if __XPG_VISIBLE >= 420
174: pid_t getpgid(pid_t);
175: pid_t getsid(pid_t);
176: #endif
177:
178: #if __XPG_VISIBLE >= 500
179: ssize_t pread(int, void *, size_t, off_t);
180: ssize_t pwrite(int, const void *, size_t, off_t);
181: int ttyname_r(int, char *, size_t)
182: ;
183: #endif
184:
185: #if __BSD_VISIBLE || __XPG_VISIBLE <= 500
186:
187: int brk(void *);
188: int chroot(const char *);
189: int getdtablesize(void);
190: int getpagesize(void);
191: char *getpass(const char *);
192: void *sbrk(int);
193: #endif
194:
195: #if __POSIX_VISIBLE >= 200112 || __XPG_VISIBLE >= 420
196: int lockf(int, int, off_t);
197: #endif
198:
199: #if __POSIX_VISIBLE >= 200112 || __XPG_VISIBLE >= 420 || __BSD_VISIBLE
200: int symlink(const char *, const char *);
201: int gethostname(char *, size_t)
202: ;
203: int setegid(gid_t);
204: int seteuid(uid_t);
205: #endif
206:
207: #if __POSIX_VISIBLE >= 200809
208: int faccessat(int, const char *, int, int);
209: int fchownat(int, const char *, uid_t, gid_t, int);
210: int linkat(int, const char *, int, const char *, int);
211: ssize_t readlinkat(int, const char *, char *, size_t);
212: int symlinkat(const char *, int, const char *);
213: int unlinkat(int, const char *, int);
214: #endif
215:
216: #if __BSD_VISIBLE
217: int acct(const char *);
218: int closefrom(int);
219: int des_cipher(const char *, char *, int32_t, int);
220: int des_setkey(const char *);
221: void endusershell(void);
222: int exect(const char *, char * const *, char * const *);
223: char *fflagstostr(u_int32_t);
224: int getdomainname(char *, size_t)
225: ;
226: int getgrouplist(const char *, gid_t, gid_t *, int *);
227: mode_t getmode(const void *, mode_t);
228: int getresgid(gid_t *, gid_t *, gid_t *);
229: int getresuid(uid_t *, uid_t *, uid_t *);
230: char *getusershell(void);
231: int initgroups(const char *, gid_t);
232: int iruserok(u_int32_t, int, const char *, const char *);
233: int iruserok_sa(const void *, int, int, const char *, const char *);
234: int issetugid(void);
235: char *mkdtemp(char *);
236: int mkstemps(char *, int);
237: int nfssvc(int, void *);
238: int profil(char *, size_t, unsigned long, unsigned int)
239: ;
240: int quotactl(const char *, int, int, char *);
241: int rcmd(char **, int, const char *,
242: const char *, const char *, int *);
243: int rcmd_af(char **, int, const char *,
244: const char *, const char *, int *, int);
245: int rcmdsh(char **, int, const char *,
246: const char *, const char *, char *);
247: char *re_comp(const char *);
248: int re_exec(const char *);
249: int reboot(int);
250: int revoke(const char *);
251: int rfork(int opts);
252: int rresvport(int *);
253: int rresvport_af(int *, int);
254: int ruserok(const char *, int, const char *, const char *);
255: #ifndef _SELECT_DEFINED_
256: #define _SELECT_DEFINED_
257: struct timeval;
258: int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
259: #endif
260: int setdomainname(const char *, size_t);
261: int setgroups(int, const gid_t *);
262: int sethostid(long);
263: int sethostname(const char *, size_t);
264: int setlogin(const char *);
265: void *setmode(const char *);
266: int setresgid(gid_t, gid_t, gid_t);
267: int setresuid(uid_t, uid_t, uid_t);
268: int setrgid(gid_t);
269: int setruid(uid_t);
270: void setusershell(void);
271: int strtofflags(char **, u_int32_t *, u_int32_t *);
272: int swapctl(int cmd, const void *arg, int misc);
273: int syscall(int, ...);
274: #endif
275: __END_DECLS
276:
277: #endif