1 static char *sccsid = "@(#)update.c 4.1 (Berkeley) 10/01/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 "/usr", 12 "/usr/bin", 13 0, 14 }; 15 16 main() 17 { 18 char **f; 19 20 if(fork()) 21 exit(0); 22 close(0); 23 close(1); 24 close(2); 25 for(f = fillst; *f; f++) 26 open(*f, 0); 27 dosync(); 28 for(;;) 29 pause(); 30 } 31 32 dosync() 33 { 34 sync(); 35 signal(SIGALRM, dosync); 36 alarm(30); 37 } 38