From e37ae2416f58f19eddebf1275768c0c1c5c953bb Mon Sep 17 00:00:00 2001 From: "Kurt A. Shoens" Date: Sat, 26 Nov 1977 18:14:02 -0800 Subject: [PATCH] BSD 1 development Work on file s6/pq.c Synthesized-from: 1bsd --- s6/pq.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 s6/pq.c diff --git a/s6/pq.c b/s6/pq.c new file mode 100644 index 0000000000..46058bf29c --- /dev/null +++ b/s6/pq.c @@ -0,0 +1,72 @@ +/* + * pq - print the quota file affecting you most immediately + * + * Kurt Shoens UCB July, 1977 + */ + struct { + char minor; /* +0: minor device of i-node */ + char major; /* +1: major device */ + int inumber; /* +2 */ + int flags; /* +4: see below */ + char nlinks; /* +6: number of links to file */ + char uid; /* +7: user ID of owner */ + char gid; /* +8: group ID of owner */ + char size0; /* +9: high byte of 24-bit size */ + int size1; /* +10: low word of 24-bit size */ + int addr[8]; /* +12: block numbers or device number */ + int actime[2]; /* +28: time of last access */ + int modtime[2]; /* +32: time of last modification */ + } inode; +main(ct,av) + char **av; +{ + int i,lastnode; + if (ct==1) + { + lastnode=0; + stat(".",&inode); + while (lastnode != inode.inumber) + { + lastnode=inode.inumber; + if (quota(".q")) + { + pq(".q"); + exit(0); + } + chdir(".."); + stat(".",&inode); + } + exit(9); + } + for (i=1;i