"Jay" == Jay Soffian <[EMAIL PROTECTED]> writes: Jay> I've attached a patch for daemontools-0.61 which creates tai64nepoch, Jay> something I hacked from tai64nlocal. I happen to rotate my logs Oops, forgot to attach the patch. Attached. j. -- Jay Soffian <[EMAIL PROTECTED]> UNIX Systems Engineer 404.572.1941 Cox Interactive Media
diff -c -N daemontools-0.61.orig/Makefile daemontools-0.61/Makefile *** daemontools-0.61.orig/Makefile Thu Aug 26 02:56:44 1999 --- daemontools-0.61/Makefile Mon Nov 1 21:44:37 1999 *************** *** 318,324 **** ./compile open_write.c prog: \ ! svscan supervise svok svstat svc fghack multilog tai64n tai64nlocal \ softlimit setuidgid envuidgid rts matchtest prot.o: \ --- 318,324 ---- ./compile open_write.c prog: \ ! svscan supervise svok svstat svc fghack multilog tai64n tai64nlocal tai64nepoch \ softlimit setuidgid envuidgid rts matchtest prot.o: \ *************** *** 557,562 **** --- 557,570 ---- tai64n.o: \ compile tai64n.c timestamp.h substdio.h readwrite.h exit.h ./compile tai64n.c + + tai64nepoch: \ + load tai64nepoch.o substdio.a error.a str.a fs.a + ./load tai64nepoch substdio.a error.a str.a fs.a + + tai64nepoch.o: \ + compile tai64nepoch.c substdio.h subfd.h substdio.h exit.h fmt.h + ./compile tai64nepoch.c tai64nlocal: \ load tai64nlocal.o substdio.a error.a str.a fs.a diff -c -N daemontools-0.61.orig/tai64nepoch.c daemontools-0.61/tai64nepoch.c *** daemontools-0.61.orig/tai64nepoch.c Wed Dec 31 19:00:00 1969 --- daemontools-0.61/tai64nepoch.c Tue Jan 4 13:09:42 2000 *************** *** 0 **** --- 1,68 ---- + #include <sys/types.h> + #include <sys/time.h> + #include "substdio.h" + #include "subfd.h" + #include "exit.h" + #include "fmt.h" + + char num[FMT_ULONG]; + + void get(ch) + char *ch; + { + int r; + + r = substdio_get(subfdin,ch,1); + if (r == 1) return; + if (r == 0) _exit(0); + _exit(111); + } + + void out(buf,len) + char *buf; + int len; + { + if (substdio_put(subfdout,buf,len) == -1) + _exit(111); + } + + time_t secs; + unsigned long nanosecs; + unsigned long u; + struct tm *t; + + main() + { + char ch; + + for (;;) { + get(&ch); + if (ch == '@') { + secs = 0; + nanosecs = 0; + for (;;) { + get(&ch); + u = ch - '0'; + if (u >= 10) { + u = ch - 'a'; + if (u >= 6) break; + u += 10; + } + secs <<= 4; + secs += nanosecs >> 28; + nanosecs &= 0xfffffff; + nanosecs <<= 4; + nanosecs += u; + } + secs -= 4611686018427387914ULL; + out(num,fmt_ulong(num,(unsigned long) (secs))); + out(".",1); + out(num,fmt_uint0(num,(unsigned int) nanosecs,9)); + } + for (;;) { + out(&ch,1); + if (ch == '\n') break; + get(&ch); + } + } + }