root/include/unistd.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 #ifndef _UNISTD_H
   2 #define _UNISTD_H
   3 
   4 /* ok, this may be a joke, but I'm working on it */
   5 #define _POSIX_VERSION 198808L
   6 
   7 #define _POSIX_CHOWN_RESTRICTED 1    /* only root can do a chown (I think..) */
   8 #define _POSIX_NO_TRUNC         1    /* no pathname truncation (but see kernel) */
   9 #define _POSIX_VDISABLE         '\0' /* character to disable things like ^C */
  10 #define _POSIX_JOB_CONTROL      1
  11 #define _POSIX_SAVED_IDS        1    /* Implemented, for whatever good it is */
  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 /* access */
  22 #define F_OK    0
  23 #define X_OK    1
  24 #define W_OK    2
  25 #define R_OK    4
  26 
  27 /* lseek */
  28 #define SEEK_SET        0
  29 #define SEEK_CUR        1
  30 #define SEEK_END        2
  31 
  32 /* _SC stands for System Configuration. We don't use them much */
  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 /* more (possibly) configurable things - now pathnames */
  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 /* XXX - <sys/stat.h> illegally <sys/types.h> already.
  55  * The rest of these includes are also illegal (too much pollution).
  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 /* __LIBRARY__ */
  69 
  70 /* XXX - illegal. */
  71 extern int errno;
  72 
  73 /* XXX - several non-POSIX functions here, and POSIX functions that are
  74  * supposed to be declared elsewhere.  Non-promotion of short types in
  75  * prototypes may cause trouble.  Arg names should be prefixed by
  76  * underscores.
  77  */
  78 int access(const char * filename, mode_t mode); /* XXX - short type */
  79 int acct(const char * filename);
  80 int brk(void * end_data_segment);
  81 /* XXX - POSIX says unsigned alarm(unsigned sec) */
  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);  /* XXX - short type */
  86 int chown(const char * filename, uid_t owner, gid_t group); /* XXX - shorts */
  87 int chroot(const char * filename);
  88 int close(int fildes);
  89 int creat(const char * filename, mode_t mode);  /* XXX - short type */
  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); /* XXX - shorts */
 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 /* XXX**2 - POSIX says unsigned count */
 117 int read(int fildes, char * buf, off_t count);
 118 int setpgrp(void);
 119 int setpgid(pid_t pid,pid_t pgid);      /* XXX - short types */
 120 int setuid(uid_t uid);          /* XXX - short type */
 121 int setgid(gid_t gid);          /* XXX - short type */
 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 /* XXX**2 - POSIX says unsigned count */
 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

/* [previous][next][first][last][top][bottom][index][help] */