Debian Codegraph @

compat/unistd.h

raw
1 /*
2 * unistd.h --
3 *
4 * Macros, constants and prototypes for Posix conformance.
5 *
6 * Copyright 1989 Regents of the University of California Permission to use,
7 * copy, modify, and distribute this software and its documentation for any
8 * purpose and without fee is hereby granted, provided that the above
9 * copyright notice appear in all copies. The University of California makes
10 * no representations about the suitability of this software for any purpose.
11 * It is provided "as is" without express or implied warranty.
12 */
13
14 #ifndef _UNISTD
15 #define _UNISTD
16
17 #include <sys/types.h>
18
19 #ifndef NULL
20 # define NULL 0
21 #endif
22
23 /*
24 * Strict POSIX stuff goes here. Extensions go down below, in the ifndef
25 * _POSIX_SOURCE section.
26 */
27
28 extern void _exit(int status);
29 extern int access(const char *path, int mode);
30 extern int chdir(const char *path);
31 extern int chown(const char *path, uid_t owner, gid_t group);
32 extern int close(int fd);
33 extern int dup(int oldfd);
34 extern int dup2(int oldfd, int newfd);
35 extern int execl(const char *path, ...);
36 extern int execle(const char *path, ...);
37 extern int execlp(const char *file, ...);
38 extern int execv(const char *path, char *const argv[]);
39 extern int execve(const char *path, char *const argv[], char *const *envp);
40 extern int execvp(const char *file, char *const argv[]);
41 extern pid_t fork(void);
42 extern char * getcwd(char *buf, size_t size);
43 extern gid_t getegid(void);
44 extern uid_t geteuid(void);
45 extern gid_t getgid(void);
46 extern int getgroups(int bufSize, int *buffer);
47 extern pid_t getpid(void);
48 extern uid_t getuid(void);
49 extern int isatty(int fd);
50 extern long lseek(int fd, long offset, int whence);
51 extern int pipe(int *fildes);
52 extern int read(int fd, char *buf, size_t size);
53 extern int setgid(gid_t group);
54 extern int setuid(uid_t user);
55 extern unsigned sleep(unsigned seconds);
56 extern char * ttyname(int fd);
57 extern int unlink(const char *path);
58 extern int write(int fd, const char *buf, size_t size);
59
60 #ifndef _POSIX_SOURCE
61 extern char * crypt(const char *, const char *);
62 extern int fchown(int fd, uid_t owner, gid_t group);
63 extern int flock(int fd, int operation);
64 extern int ftruncate(int fd, unsigned long length);
65 extern int ioctl(int fd, int request, ...);
66 extern int readlink(const char *path, char *buf, int bufsize);
67 extern int setegid(gid_t group);
68 extern int seteuid(uid_t user);
69 extern int setreuid(int ruid, int euid);
70 extern int symlink(const char *, const char *);
71 extern int ttyslot(void);
72 extern int truncate(const char *path, unsigned long length);
73 extern int vfork(void);
74 #endif /* _POSIX_SOURCE */
75
76 #endif /* _UNISTD */