Bell 32V development
[unix-history] / usr / src / cmd / update.c
CommitLineData
3b600ead
TL
1/*
2 * Update the file system every 30 seconds.
3 * For cache benefit, open certain system directories.
4 */
5
6#include <signal.h>
7
8char *fillst[] = {
9 "/bin",
10 "/usr",
11 "/usr/bin",
12 0,
13};
14
15main()
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
31dosync()
32{
33 sync();
34 signal(SIGALRM, dosync);
35 alarm(30);
36}