|
|
1.1 ! root 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 /* only root can do a chown (I think..) */ ! 8: /* #define _POSIX_NO_TRUNC*/ /* pathname truncation (but see in kernel) */ ! 9: #define _POSIX_VDISABLE '\0' /* character to disable things like ^C */ ! 10: /*#define _POSIX_SAVED_IDS */ /* we'll get to this yet */ ! 11: /*#define _POSIX_JOB_CONTROL */ /* we aren't there quite yet. Soon hopefully */ ! 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: #include <sys/stat.h> ! 54: #include <sys/times.h> ! 55: #include <sys/utsname.h> ! 56: #include <utime.h> ! 57: ! 58: #ifdef __LIBRARY__ ! 59: ! 60: #define __NR_setup 0 /* used only by init, to get system going */ ! 61: #define __NR_exit 1 ! 62: #define __NR_fork 2 ! 63: #define __NR_read 3 ! 64: #define __NR_write 4 ! 65: #define __NR_open 5 ! 66: #define __NR_close 6 ! 67: #define __NR_waitpid 7 ! 68: #define __NR_creat 8 ! 69: #define __NR_link 9 ! 70: #define __NR_unlink 10 ! 71: #define __NR_execve 11 ! 72: #define __NR_chdir 12 ! 73: #define __NR_time 13 ! 74: #define __NR_mknod 14 ! 75: #define __NR_chmod 15 ! 76: #define __NR_chown 16 ! 77: #define __NR_break 17 ! 78: #define __NR_stat 18 ! 79: #define __NR_lseek 19 ! 80: #define __NR_getpid 20 ! 81: #define __NR_mount 21 ! 82: #define __NR_umount 22 ! 83: #define __NR_setuid 23 ! 84: #define __NR_getuid 24 ! 85: #define __NR_stime 25 ! 86: #define __NR_ptrace 26 ! 87: #define __NR_alarm 27 ! 88: #define __NR_fstat 28 ! 89: #define __NR_pause 29 ! 90: #define __NR_utime 30 ! 91: #define __NR_stty 31 ! 92: #define __NR_gtty 32 ! 93: #define __NR_access 33 ! 94: #define __NR_nice 34 ! 95: #define __NR_ftime 35 ! 96: #define __NR_sync 36 ! 97: #define __NR_kill 37 ! 98: #define __NR_rename 38 ! 99: #define __NR_mkdir 39 ! 100: #define __NR_rmdir 40 ! 101: #define __NR_dup 41 ! 102: #define __NR_pipe 42 ! 103: #define __NR_times 43 ! 104: #define __NR_prof 44 ! 105: #define __NR_brk 45 ! 106: #define __NR_setgid 46 ! 107: #define __NR_getgid 47 ! 108: #define __NR_signal 48 ! 109: #define __NR_geteuid 49 ! 110: #define __NR_getegid 50 ! 111: #define __NR_acct 51 ! 112: #define __NR_phys 52 ! 113: #define __NR_lock 53 ! 114: #define __NR_ioctl 54 ! 115: #define __NR_fcntl 55 ! 116: #define __NR_mpx 56 ! 117: #define __NR_setpgid 57 ! 118: #define __NR_ulimit 58 ! 119: #define __NR_uname 59 ! 120: #define __NR_umask 60 ! 121: #define __NR_chroot 61 ! 122: #define __NR_ustat 62 ! 123: #define __NR_dup2 63 ! 124: #define __NR_getppid 64 ! 125: #define __NR_getpgrp 65 ! 126: #define __NR_setsid 66 ! 127: ! 128: #define _syscall0(type,name) \ ! 129: type name(void) \ ! 130: { \ ! 131: type __res; \ ! 132: __asm__ volatile ("int $0x80" \ ! 133: : "=a" (__res) \ ! 134: : "0" (__NR_##name)); \ ! 135: if (__res >= 0) \ ! 136: return __res; \ ! 137: errno = -__res; \ ! 138: return -1; \ ! 139: } ! 140: ! 141: #define _syscall1(type,name,atype,a) \ ! 142: type name(atype a) \ ! 143: { \ ! 144: type __res; \ ! 145: __asm__ volatile ("int $0x80" \ ! 146: : "=a" (__res) \ ! 147: : "0" (__NR_##name),"b" (a)); \ ! 148: if (__res >= 0) \ ! 149: return __res; \ ! 150: errno = -__res; \ ! 151: return -1; \ ! 152: } ! 153: ! 154: #define _syscall2(type,name,atype,a,btype,b) \ ! 155: type name(atype a,btype b) \ ! 156: { \ ! 157: type __res; \ ! 158: __asm__ volatile ("int $0x80" \ ! 159: : "=a" (__res) \ ! 160: : "0" (__NR_##name),"b" (a),"c" (b)); \ ! 161: if (__res >= 0) \ ! 162: return __res; \ ! 163: errno = -__res; \ ! 164: return -1; \ ! 165: } ! 166: ! 167: #define _syscall3(type,name,atype,a,btype,b,ctype,c) \ ! 168: type name(atype a,btype b,ctype c) \ ! 169: { \ ! 170: type __res; \ ! 171: __asm__ volatile ("int $0x80" \ ! 172: : "=a" (__res) \ ! 173: : "0" (__NR_##name),"b" (a),"c" (b),"d" (c)); \ ! 174: if (__res<0) \ ! 175: errno=-__res , __res = -1; \ ! 176: return __res;\ ! 177: } ! 178: ! 179: #endif /* __LIBRARY__ */ ! 180: ! 181: extern int errno; ! 182: ! 183: int access(const char * filename, mode_t mode); ! 184: int acct(const char * filename); ! 185: int alarm(int sec); ! 186: int brk(void * end_data_segment); ! 187: void * sbrk(ptrdiff_t increment); ! 188: int chdir(const char * filename); ! 189: int chmod(const char * filename, mode_t mode); ! 190: int chown(const char * filename, uid_t owner, gid_t group); ! 191: int chroot(const char * filename); ! 192: int close(int fildes); ! 193: int creat(const char * filename, mode_t mode); ! 194: int dup(int fildes); ! 195: int execve(const char * filename, char ** argv, char ** envp); ! 196: int execv(const char * pathname, char ** argv); ! 197: int execvp(const char * file, char ** argv); ! 198: int execl(const char * pathname, char * arg0, ...); ! 199: int execlp(const char * file, char * arg0, ...); ! 200: int execle(const char * pathname, char * arg0, ...); ! 201: volatile void exit(int status); ! 202: volatile void _exit(int status); ! 203: int fcntl(int fildes, int cmd, ...); ! 204: int fork(void); ! 205: int getpid(void); ! 206: int getuid(void); ! 207: int geteuid(void); ! 208: int getgid(void); ! 209: int getegid(void); ! 210: int ioctl(int fildes, int cmd, ...); ! 211: int kill(pid_t pid, int signal); ! 212: int link(const char * filename1, const char * filename2); ! 213: int lseek(int fildes, off_t offset, int origin); ! 214: int mknod(const char * filename, mode_t mode, dev_t dev); ! 215: int mount(const char * specialfile, const char * dir, int rwflag); ! 216: int nice(int val); ! 217: int open(const char * filename, int flag, ...); ! 218: int pause(void); ! 219: int pipe(int * fildes); ! 220: int read(int fildes, char * buf, off_t count); ! 221: int setpgrp(void); ! 222: int setpgid(pid_t pid,pid_t pgid); ! 223: int setuid(uid_t uid); ! 224: int setgid(gid_t gid); ! 225: void (*signal(int sig, void (*fn)(int)))(int); ! 226: int stat(const char * filename, struct stat * stat_buf); ! 227: int fstat(int fildes, struct stat * stat_buf); ! 228: int stime(time_t * tptr); ! 229: int sync(void); ! 230: time_t time(time_t * tloc); ! 231: time_t times(struct tms * tbuf); ! 232: int ulimit(int cmd, long limit); ! 233: mode_t umask(mode_t mask); ! 234: int umount(const char * specialfile); ! 235: int uname(struct utsname * name); ! 236: int unlink(const char * filename); ! 237: int ustat(dev_t dev, struct ustat * ubuf); ! 238: int utime(const char * filename, struct utimbuf * times); ! 239: pid_t waitpid(pid_t pid,int * wait_stat,int options); ! 240: pid_t wait(int * wait_stat); ! 241: int write(int fildes, const char * buf, off_t count); ! 242: int dup2(int oldfd, int newfd); ! 243: int getppid(void); ! 244: pid_t getpgrp(void); ! 245: pid_t setsid(void); ! 246: ! 247: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.