Pristine Ack-5.5
[Ack-5.5.git] / lib / minix / include / unistd.h
1 /* The <unistd.h> header contains a few miscellaneous manifest constants. */
2
3 #ifndef _UNISTD_H
4 #define _UNISTD_H
5
6 /* Values used by access().  POSIX Table 2-6. */
7 #define F_OK               0    /* test if file exists */
8 #define X_OK               1    /* test if file is executable */
9 #define W_OK               2    /* test if file is writable */
10 #define R_OK               4    /* test if file is readable */
11
12 /* Values used for whence in lseek(fd, offset, whence).  POSIX Table 2-7. */
13 #define SEEK_SET           0    /* offset is absolute  */
14 #define SEEK_CUR           1    /* offset is relative to current position */
15 #define SEEK_END           2    /* offset is relative to end of file */
16
17 /* This value is required by POSIX Table 2-8. */
18 #define _POSIX_VERSION 198808L  /* which standard is being conformed to */
19
20 /* These three definitions are required by POSIX Sec. 8.2.1.2. */
21 #define STDIN_FILENO       0    /* file descriptor for stdin */
22 #define STDOUT_FILENO      1    /* file descriptor for stdout */
23 #define STDERR_FILENO      2    /* file descriptor for stderr */
24
25 /* NULL must be defined in <unistd.h> according to POSIX Sec. 2.8.1. */
26 #define NULL    ((void *)0)
27
28 /* The following relate to configurable system variables. POSIX Table 4-2. */
29 #define _SC_ARG_MAX             1
30 #define _SC_CHILD_MAX           2
31 #define _SC_CLOCKS_PER_SEC      3
32 #define _SC_NGROUPS_MAX         4
33 #define _SC_OPEN_MAX            5
34 #define _SC_JOB_CONTROL         6
35 #define _SC_SAVED_IDS           7
36 #define _SC_VERSION             8
37
38 /* The following relate to configurable pathname variables. POSIX Table 5-2. */
39 #define _PC_LINK_MAX            1       /* link count */
40 #define _PC_MAX_CANON           2       /* size of the canonical input queue */
41 #define _PC_MAX_INPUT           3       /* type-ahead buffer size */
42 #define _PC_NAME_MAX            4       /* file name size */
43 #define _PC_PATH_MAX            5       /* pathname size */
44 #define _PC_PIPE_BUF            6       /* pipe size */
45 #define _PC_NO_TRUNC            7       /* treatment of long name components */
46 #define _PC_VDISABLE            8       /* tty disable */
47 #define _PC_CHOWN_RESTRICTED    9       /* chown restricted or not */
48
49 /* POSIX defines several options that may be implemented or not, at the
50  * implementer's whim.  This implementer has made the following choices:
51  *
52  * _POSIX_JOB_CONTROL       not defined:        no job control
53  * _POSIX_SAVED_IDS         not defined:        no saved uid/gid
54  * _POSIX_NO_TRUNC          not defined:        long path names are truncated
55  * _POSIX_CHOWN_RESTRICTED  defined:            you can't give away files
56  * _POSIX_VDISABLE          defined:            tty functions can be disabled
57  */
58 #define _POSIX_CHOWN_RESTRICTED
59 #define _POSIX_VDISABLE '\t'    /* can't set any control char to tab */
60
61
62 /* Function Prototypes. */
63 #ifndef _ANSI_H
64 #include <ansi.h>
65 #endif
66
67 _PROTOTYPE( void _exit, (int _status)                                   );
68 _PROTOTYPE( int access, (char *_path, int _amode)                       );
69 _PROTOTYPE( int chdir, (char *_path)                                    );
70 _PROTOTYPE( int chown, (char *_path, int _owner, int _group)            );
71 _PROTOTYPE( int close, (int _fd)                                        );
72 _PROTOTYPE( char *ctermid, (char *_s)                                   );
73 _PROTOTYPE( char *cuserid, (char *_s)                                   );
74 _PROTOTYPE( int dup, (int _fd)                                          );
75 _PROTOTYPE( int dup2, (int _fd, int _fd2)                               );
76 _PROTOTYPE( int execl, (char *_path, ...)                               );
77 _PROTOTYPE( int execle, (char *_path, ...)                              );
78 _PROTOTYPE( int execlp, (char *_file, ...)                              );
79 _PROTOTYPE( int execv, (char *_path, char *_argv[])                     );
80 _PROTOTYPE( int execve, (char *_path, char *_argv[], char *_envp[])     );
81 _PROTOTYPE( int execvp, (char *_file, char *_argv[])                    );
82 _PROTOTYPE( pid_t fork, (void)                                          );
83 _PROTOTYPE( long fpathconf, (int _fd, int _name)                        );
84 _PROTOTYPE( char *getcwd, (char *_buf, int _size)                       );
85 _PROTOTYPE( gid_t getegid, (void)                                       );
86 _PROTOTYPE( uid_t geteuid, (void)                                       );
87 _PROTOTYPE( gid_t getgid, (void)                                        );
88 _PROTOTYPE( int getgroups, (int _gidsetsize, gid_t _grouplist[])        );
89 _PROTOTYPE( char *getlogin, (void)                                      );
90 _PROTOTYPE( pid_t getpgrp, (void)                                       );
91 _PROTOTYPE( pid_t getpid, (void)                                        );
92 _PROTOTYPE( pid_t getppid, (void)                                       );
93 _PROTOTYPE( uid_t getuid, (void)                                        );
94 _PROTOTYPE( unsigned int alarm, (unsigned int _seconds)                 );
95 _PROTOTYPE( unsigned int sleep, (unsigned int _seconds)                 );
96 _PROTOTYPE( int isatty, (int _fd)                                       );
97 _PROTOTYPE( int link, (const char *_path1, const char *_path2)          );
98 _PROTOTYPE( off_t lseek, (int _fd, off_t _offset, int _whence)          );
99 _PROTOTYPE( long pathconf, (char *_path, int _name)                     );
100 _PROTOTYPE( int pause, (void)                                           );
101 _PROTOTYPE( int pipe, (int _fildes[2])                                  );
102 _PROTOTYPE( int read, (int _fd, char *_buf, unsigned int _n)            );
103 _PROTOTYPE( int rmdir, (const char *_path)                              );
104 _PROTOTYPE( int setgid, (int _gid)                                      );
105 _PROTOTYPE( int setpgid, (pid_t _pid, pid_t _pgid)                      );
106 _PROTOTYPE( pid_t setsid, (void)                                        );
107 _PROTOTYPE( int setuid, (int _uid)                                      );
108 _PROTOTYPE( long sysconf, (int _name)                                   );
109 _PROTOTYPE( pid_t tcgetpgrp, (int _fd)                                  );
110 _PROTOTYPE( int tcsetpgrp, (int _fd, pid_t _pgrp_id)                    );
111 _PROTOTYPE( char *ttyname, (int _fd)                                    );
112 _PROTOTYPE( int unlink, (const char *_path)                             );
113 _PROTOTYPE( int write, (int _fd, char *_buf, unsigned int _n)           );
114
115 #ifdef _MINIX
116 _PROTOTYPE( char *brk, (char *_addr)                                    );
117 _PROTOTYPE( int mknod, (const char *_name, int _mode, int _addr)        );
118 _PROTOTYPE( int mknod4, (const char *_name, int _mode, int _addr,
119             unsigned _size)                                             );
120 _PROTOTYPE( char *mktemp, (char *_template)                             );
121 _PROTOTYPE( char *sbrk, (int _incr)                                     );
122 _PROTOTYPE( int chroot, (const char *_name)                             );
123 _PROTOTYPE( int mount, (char *_spec, char *_name, int _flag));
124 _PROTOTYPE( long ptrace, (int _req, int _pid, long _addr, long _data)   );
125 _PROTOTYPE( int stime, (long *top)                                      );
126 _PROTOTYPE( int sync, (void)                                            );
127 _PROTOTYPE( int umount, (const char *_name)                             );
128 #endif
129
130 #endif /* _UNISTD_H */