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: }

Defined functions

dosync defined in line 35; used 2 times
main defined in line 19; never used

Defined variables

fillst defined in line 9; used 1 times
  • in line 28
sccsid defined in line 1; never used
Last modified: 1983-06-12
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 942
Valid CSS Valid XHTML 1.0 Strict