00001
00002
00003 #ifndef _UNISTD_H
00004 #define _UNISTD_H
00005
00006 #ifndef _TYPES_H
00007 #include <minix/types.h>
00008 #endif
00009
00010
00011 #define F_OK 0
00012 #define X_OK 1
00013 #define W_OK 2
00014 #define R_OK 4
00015
00016
00017 #define SEEK_SET 0
00018 #define SEEK_CUR 1
00019 #define SEEK_END 2
00020
00021
00022 #define _POSIX_VERSION 199009L
00023
00024
00025 #define STDIN_FILENO 0
00026 #define STDOUT_FILENO 1
00027 #define STDERR_FILENO 2
00028
00029 #ifdef _MINIX
00030
00031 #define RBT_HALT 0
00032 #define RBT_REBOOT 1
00033 #define RBT_PANIC 2
00034 #define RBT_MONITOR 3
00035 #define RBT_RESET 4
00036 #define RBT_INVALID 5
00037
00038 #define _PM_SEG_FLAG (1L << 30)
00039 #endif
00040
00041
00042 #define SI_KINFO 0
00043 #define SI_PROC_ADDR 1
00044 #define SI_PROC_TAB 2
00045 #define SI_DMAP_TAB 3
00046 #define SI_MEM_ALLOC 4
00047 #define SI_DATA_STORE 5
00048 #define SI_SUBSCRIPTION 6
00049 #define SI_LOADINFO 7
00050 #define SI_KPROC_TAB 8
00051 #define SI_CALL_STATS 9
00052 #define SI_PCI_INFO 10
00053 #define SI_PROCPUB_TAB 11
00054
00055
00056 #define NULL ((void *)0)
00057
00058
00059 #define _SC_ARG_MAX 1
00060 #define _SC_CHILD_MAX 2
00061 #define _SC_CLOCKS_PER_SEC 3
00062 #define _SC_CLK_TCK 3
00063 #define _SC_NGROUPS_MAX 4
00064 #define _SC_OPEN_MAX 5
00065 #define _SC_JOB_CONTROL 6
00066 #define _SC_SAVED_IDS 7
00067 #define _SC_VERSION 8
00068 #define _SC_STREAM_MAX 9
00069 #define _SC_TZNAME_MAX 10
00070 #define _SC_PAGESIZE 11
00071 #define _SC_PAGE_SIZE _SC_PAGESIZE
00072
00073
00074 #define _PC_LINK_MAX 1
00075 #define _PC_MAX_CANON 2
00076 #define _PC_MAX_INPUT 3
00077 #define _PC_NAME_MAX 4
00078 #define _PC_PATH_MAX 5
00079 #define _PC_PIPE_BUF 6
00080 #define _PC_NO_TRUNC 7
00081 #define _PC_VDISABLE 8
00082 #define _PC_CHOWN_RESTRICTED 9
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093 #define _POSIX_NO_TRUNC (-1)
00094 #define _POSIX_CHOWN_RESTRICTED 1
00095
00096
00097 _PROTOTYPE( void _exit, (int _status) );
00098 _PROTOTYPE( int access, (const char *_path, int _amode) );
00099 _PROTOTYPE( unsigned int alarm, (unsigned int _seconds) );
00100 _PROTOTYPE( int chdir, (const char *_path) );
00101 _PROTOTYPE( int fchdir, (int fd) );
00102 _PROTOTYPE( int chown, (const char *_path, _mnx_Uid_t _owner, _mnx_Gid_t _group) );
00103 _PROTOTYPE( int fchown, (int fd, _mnx_Uid_t _owner, _mnx_Gid_t _group) );
00104 _PROTOTYPE( int close, (int _fd) );
00105 _PROTOTYPE( char *ctermid, (char *_s) );
00106 _PROTOTYPE( char *cuserid, (char *_s) );
00107 _PROTOTYPE( int dup, (int _fd) );
00108 _PROTOTYPE( int dup2, (int _fd, int _fd2) );
00109 _PROTOTYPE( int execl, (const char *_path, const char *_arg, ...) );
00110 _PROTOTYPE( int execle, (const char *_path, const char *_arg, ...) );
00111 _PROTOTYPE( int execlp, (const char *_file, const char *arg, ...) );
00112 _PROTOTYPE( int execv, (const char *_path, char *const _argv[]) );
00113 _PROTOTYPE( int execve, (const char *_path, char *const _argv[],
00114 char *const _envp[]) );
00115 _PROTOTYPE( int execvp, (const char *_file, char *const _argv[]) );
00116 _PROTOTYPE( pid_t fork, (void) );
00117 _PROTOTYPE( long fpathconf, (int _fd, int _name) );
00118 _PROTOTYPE( char *getcwd, (char *_buf, size_t _size) );
00119 _PROTOTYPE( gid_t getegid, (void) );
00120 _PROTOTYPE( uid_t geteuid, (void) );
00121 _PROTOTYPE( gid_t getgid, (void) );
00122 _PROTOTYPE( int getgroups, (int _gidsetsize, gid_t _grouplist[]) );
00123 _PROTOTYPE( int setgroups, (int _ngroups, gid_t const *grps) );
00124 _PROTOTYPE( char *getlogin, (void) );
00125 _PROTOTYPE( pid_t getpgrp, (void) );
00126 _PROTOTYPE( pid_t getpid, (void) );
00127 _PROTOTYPE( pid_t getppid, (void) );
00128 _PROTOTYPE( uid_t getuid, (void) );
00129 _PROTOTYPE( int isatty, (int _fd) );
00130 _PROTOTYPE( int link, (const char *_existing, const char *_new) );
00131 _PROTOTYPE( off_t lseek, (int _fd, off_t _offset, int _whence) );
00132 _PROTOTYPE( long pathconf, (const char *_path, int _name) );
00133 _PROTOTYPE( int pause, (void) );
00134 _PROTOTYPE( int pipe, (int _fildes[2]) );
00135 _PROTOTYPE( ssize_t read, (int _fd, void *_buf, size_t _n) );
00136 _PROTOTYPE( int rmdir, (const char *_path) );
00137 _PROTOTYPE( int setgid, (_mnx_Gid_t _gid) );
00138 _PROTOTYPE( int setegid, (_mnx_Gid_t _gid) );
00139 _PROTOTYPE( int setpgid, (pid_t _pid, pid_t _pgid) );
00140 _PROTOTYPE( pid_t setsid, (void) );
00141 _PROTOTYPE( int setuid, (_mnx_Uid_t _uid) );
00142 _PROTOTYPE( int seteuid, (_mnx_Uid_t _uid) );
00143 _PROTOTYPE( unsigned int sleep, (unsigned int _seconds) );
00144 _PROTOTYPE( long sysconf, (int _name) );
00145 _PROTOTYPE( pid_t tcgetpgrp, (int _fd) );
00146 _PROTOTYPE( int tcsetpgrp, (int _fd, pid_t _pgrp_id) );
00147 _PROTOTYPE( char *ttyname, (int _fd) );
00148 _PROTOTYPE( int unlink, (const char *_path) );
00149 _PROTOTYPE( ssize_t write, (int _fd, const void *_buf, size_t _n) );
00150 _PROTOTYPE( int truncate, (const char *_path, off_t _length) );
00151 _PROTOTYPE( int ftruncate, (int _fd, off_t _length) );
00152 _PROTOTYPE( int nice, (int _incr) );
00153
00154
00155 _PROTOTYPE( int symlink, (const char *path1, const char *path2) );
00156 _PROTOTYPE( int readlink, (const char *, char *, size_t) );
00157 _PROTOTYPE( int getopt, (int _argc, char * const _argv[], char const *_opts) );
00158 extern char *optarg;
00159 extern int optind, opterr, optopt;
00160 _PROTOTYPE( int usleep, (useconds_t _useconds) );
00161
00162 #ifdef _MINIX
00163 #ifndef _TYPE_H
00164 #include <minix/type.h>
00165 #endif
00166
00167 extern int optreset;
00168
00169 _PROTOTYPE( int brk, (char *_addr) );
00170 _PROTOTYPE( int chroot, (const char *_name) );
00171 _PROTOTYPE( int lseek64, (int _fd, u64_t _offset, int _whence,
00172 u64_t *_newpos) );
00173 _PROTOTYPE( int mknod, (const char *_name, _mnx_Mode_t _mode, Dev_t _addr) );
00174 _PROTOTYPE( int mknod4, (const char *_name, _mnx_Mode_t _mode, Dev_t _addr,
00175 long _size) );
00176 _PROTOTYPE( char *mktemp, (char *_template) );
00177 _PROTOTYPE( long ptrace, (int _req, pid_t _pid, long _addr, long _data) );
00178 _PROTOTYPE( char *sbrk, (int _incr) );
00179 _PROTOTYPE( int sync, (void) );
00180 _PROTOTYPE( int fsync, (int fd) );
00181 _PROTOTYPE( int reboot, (int _how, ...) );
00182 _PROTOTYPE( int gethostname, (char *_hostname, size_t _len) );
00183 _PROTOTYPE( int getdomainname, (char *_domain, size_t _len) );
00184 _PROTOTYPE( int ttyslot, (void) );
00185 _PROTOTYPE( int fttyslot, (int _fd) );
00186 _PROTOTYPE( char *crypt, (const char *_key, const char *_salt) );
00187 _PROTOTYPE( int getsysinfo, (endpoint_t who, int what, void *where) );
00188 _PROTOTYPE( int getsigset, (sigset_t *sigset) );
00189 _PROTOTYPE( int getprocnr, (void) );
00190 _PROTOTYPE( int getnprocnr, (pid_t pid) );
00191 _PROTOTYPE( int getpprocnr, (void) );
00192 _PROTOTYPE( int _pm_findproc, (char *proc_name, int *proc_nr) );
00193 _PROTOTYPE( int mapdriver, (char *label, int major, int style,
00194 int force) );
00195 _PROTOTYPE(int adddma, (endpoint_t proc_e,
00196 phys_bytes start, phys_bytes size) );
00197 _PROTOTYPE(int deldma, (endpoint_t proc_e,
00198 phys_bytes start, phys_bytes size) );
00199 _PROTOTYPE(int getdma, (endpoint_t *procp, phys_bytes *basep,
00200 phys_bytes *sizep) );
00201
00202 _PROTOTYPE( pid_t getnpid, (endpoint_t proc_ep) );
00203 _PROTOTYPE( uid_t getnuid, (endpoint_t proc_ep) );
00204 _PROTOTYPE( gid_t getngid, (endpoint_t proc_ep) );
00205
00206
00207 _PROTOTYPE( int getpagesize, (void) );
00208 _PROTOTYPE( int setgroups, (int ngroups, const gid_t *gidset) );
00209 _PROTOTYPE( int initgroups, (const char *name, gid_t basegid) );
00210
00211 #endif
00212
00213 #ifdef _POSIX_SOURCE
00214 _PROTOTYPE( int getdtablesize, (void) );
00215 #endif
00216
00217 #endif