|
|
1.1 ! root 1: static char *sccsid = "@(#)update.c 4.2 (Berkeley) 10/16/80"; ! 2: /* ! 3: * Update the file system every 30 seconds. ! 4: * For cache benefit, open certain system directories. ! 5: */ ! 6: ! 7: #include <signal.h> ! 8: ! 9: char *fillst[] = { ! 10: "/bin", ! 11: "/lib", ! 12: "/usr", ! 13: "/usr/bin", ! 14: "/usr/lib", ! 15: "/usr/ucb", ! 16: 0, ! 17: }; ! 18: ! 19: main() ! 20: { ! 21: char **f; ! 22: ! 23: if(fork()) ! 24: exit(0); ! 25: close(0); ! 26: close(1); ! 27: close(2); ! 28: for(f = fillst; *f; f++) ! 29: open(*f, 0); ! 30: dosync(); ! 31: for(;;) ! 32: pause(); ! 33: } ! 34: ! 35: dosync() ! 36: { ! 37: sync(); ! 38: signal(SIGALRM, dosync); ! 39: alarm(30); ! 40: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.