PLEX86  x86- Virtual Machine (VM) Program
 CVS  |  Mailing List  |  Download  |  Newsgroups

Unix 6th edition man macros


Your Ad Here

Your Ad Here

ADM3A 2992
On Fri, 10 Mar 2006 02:02:13 -0500 Damn I've sat in front of enough of them - and I never did find out but a quick look...

Exercise complete (though, it depends on sys-endian.h. It could probably be modified to use in-netinet.h or manual reordering - it probably also needs changes where the magic is used). I did this based on ar.c in the 7th edition sources I tried it with the v6 one, but couldn't make it work - since v7's api, and for that matter its C syntax, is much closer to a "modern" unix, it was less effort

ar.h: #ifndef ARH #define ARH #if BYTEORDER == LITTLEENDIAN #define ARMAG INT32C(0x65FF0000) #else #define ARMAG INT32C(0xFF65) #endif struct arhdr { char arname14; int8t aruid; int8t argid; int32t ardate; int32t arsize; int32t armode; } attribute((packed)); #endif

`diff -u ..-v7-cmd-ar.c ar.c` --- ..-v7-cmd-ar.c Wed Jan 10 00:00:00 1979 +++ ar.c Sat Mar 11 18:00:50 2006 +#include "ar.h" + + + + +#define rcmd ARrcmd +#define select ARslct + struct stat stbuf; struct arhdr arbuf; +int writearbuf(int fd, struct arhdr *loc) { + return write(fd,loc,sizeof*loc); +} + +int readarbuf(int fd, struct arhdr *loc) { + int ret = read(fd,loc,sizeof*loc); + return ret; +} + + #define SKIP 1 #define IODD 2 #define OODD 4 char *opt = { "uvnbail" }; int signum = {SIGHUP, SIGINT, SIGQUIT, 0}; -int sigdone(); -long lseek(); +void sigdone(); int rcmd(); int dcmd(); int xcmd(); int namc; char *arnam; char *ponam; -char *tmpnam = { "-tmp-vloveXX" }; +char *tmp0nam = { "-tmp-vloveXX" }; char *tmp1nam = { "-tmp-v1loveXX" }; char *tmp2nam = { "-tmp-v2loveXX" }; char *tfnam; done(1); } if(flg'l'-'a') { - tmpnam = "vloveXX"; + tmp0nam = "vloveXX"; tmp1nam = "v1loveXX"; tmp2nam = "v2loveXX"; } { static mbuf = ARMAG; - tfnam = mktemp(tmpnam); + tfnam = mktemp(tmp0nam); close(creat(tfnam, 0600)); tf = open(tfnam, 2); done(1); } +void sigdone() { done(100); int pe; if(flag & HEAD) - if (write(fo, (char *)&arbuf, sizeof arbuf) != sizeof arbuf) + if (writearbuf(fo, &arbuf) != sizeof arbuf) wrerr(); pe = 0; { register i; - i = read(af, (char *)&arbuf, sizeof arbuf); + i = readarbuf(af, &arbuf); if(i != sizeof arbuf) { if(tf1nam) { i = tf; longt() { register char *cp; + timet ldate = arbuf.ardate; pmode(); - printf("%3d-%1d", arbuf.aruid, arbuf.argid); - printf("%7D", arbuf.arsize); - cp = ctime(&arbuf.ardate); + printf("%3"PRId8"-%1"PRId8, arbuf.aruid, arbuf.argid); + printf("%7"PRId32, arbuf.arsize); + cp = ctime(&ldate); printf(" %-12.12s %-4.4s ", cp+4, cp+20); } -------------------------

ADM3A 2993
William J. Leary Jr. IIRC, it was a "joke newsgroup" to begin with (possibly contemporaneous with alt.tv.startrek.ensign.crusher.die.die.die era). comp.terminals would certainly be appropriate, and in fact Rick Shuford's...
ADM3A 2994
The" ? Which one is "The" ? I found a number of them, with contradictory statements, or...

Compiled with gcc -fwritable-strings since i didn't feel like fixing its use of mktemp.



Your Ad Here

List | Previous | Next

ADM3A 2992

Alt Folklore Computers from Newsgroups

The #1 Usenet Provider on the Internet

MCTS 2990