1: /*
   2:  * Update the file system every 30 seconds.
   3:  * For cache benefit, open certain system directories.
   4:  */
   5: 
   6: #include <signal.h>
   7: 
   8: char *fillst[] = {
   9:     "/bin",
  10:     "/usr",
  11:     "/usr/bin",
  12:     0,
  13: };
  14: 
  15: main()
  16: {
  17:     char **f;
  18: 
  19:     if(fork())
  20:         exit(0);
  21:     close(0);
  22:     close(1);
  23:     close(2);
  24:     for(f = fillst; *f; f++)
  25:         open(*f, 0);
  26:     dosync();
  27:     for(;;)
  28:         pause();
  29: }
  30: 
  31: dosync()
  32: {
  33:     sync();
  34:     signal(SIGALRM, dosync);
  35:     alarm(30);
  36: }

Defined functions

dosync defined in line 31; used 2 times
main defined in line 15; never used

Defined variables

fillst defined in line 8; used 1 times
  • in line 24
Last modified: 1981-07-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 717
Valid CSS Valid XHTML 1.0 Strict