|
|
1.1 ! root 1: #include <sys/param.h> ! 2: #include <sys/types.h> ! 3: #include <sys/stat.h> ! 4: #include <sys/dir.h> ! 5: #include <sys/user.h> ! 6: #include <sys/proc.h> ! 7: #include <sys/reg.h> ! 8: #include <sys/pioctl.h> ! 9: ! 10: #define SYSADR 0x80000000L ! 11: ! 12: #define UBASE (SYSADR-UPAGES*NBPG) ! 13: ! 14: #define Malloc(type,n) (type *)malloc((n)*sizeof(type)) ! 15: #define Calloc(type,n) (type *)calloc((n),sizeof(type)) ! 16: #define Realloc(type,ptr,n) (type *)realloc(ptr,(n)*sizeof(type)) ! 17: #define Nalloc(type,pp,n) (type *)nalloc(pp, sizeof(type), (n)*sizeof(type)) ! 18: ! 19: char *malloc(), *calloc(), *realloc(), *nalloc(), *balloc(); ! 20: ! 21: #define Ioctl(fd,c,buf) (ioctl(fd, c, buf) >= 0) ! 22: #define Seek(fd,n) (lseek(fd, (int)(n), 0) == (int)(n)) ! 23: #define Read(fd,buf,n) (read(fd, (char *)buf, (n)) == (n)) ! 24: ! 25: #define Kread(addr, destp) (((long)(addr) & SYSADR) && Seek(kernel, addr) && \ ! 26: Read(kernel, (char *)(destp), sizeof(*(destp)))) ! 27: ! 28: #define Sread(fd, addr, destp) (Seek(fd, addr) && \ ! 29: Read(fd, (char *)(destp), sizeof(*(destp)))) ! 30: ! 31: #define min(a,b) ((a) <= (b) ? (a) : (b)) ! 32: #define max(a,b) ((a) >= (b) ? (a) : (b)) ! 33: #define minmax(x,a,b) min(b,max(a,x)) ! 34: ! 35: typedef struct Dirnode { ! 36: struct Dirnode *next; ! 37: struct direct *begin; ! 38: struct direct *end; ! 39: } Dirnode; ! 40: ! 41: typedef struct Select { ! 42: long flag; ! 43: char *id; ! 44: dev_t dev; ino_t ino; ! 45: } Select; ! 46: ! 47: #define SELTTY 1 ! 48: #define SELXFL 2 ! 49: #define SELFIL 4 ! 50: ! 51: typedef struct Psline { ! 52: int weight; ! 53: char *string; ! 54: } Psline; ! 55: ! 56: char *printp(), *fdprint(), *iprint(); ! 57: ! 58: char *gettty(), *getfs(), *getuname(), *getargs(), *memcpy(); ! 59: ! 60: Dirnode *devlist, *prlist, *getdir(); ! 61: ! 62: Select *selbeg, *selend; ! 63: ! 64: int Fflag, fflag, hflag, lflag, Nflag, nflag, Tflag, uflag; ! 65: ! 66: int aflag, rflag, tflag, xflag; ! 67: ! 68: int mypid, myuid, drum, kernel; ! 69: ! 70: char *progname;
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.