Commit | Line | Data |
---|---|---|
9f40bd24 | 1 | static char *sccsid = "@(#)update.c 4.2 (Berkeley) %G%"; |
a675940b BJ |
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", | |
9f40bd24 | 11 | "/lib", |
a675940b BJ |
12 | "/usr", |
13 | "/usr/bin", | |
9f40bd24 BJ |
14 | "/usr/lib", |
15 | "/usr/ucb", | |
a675940b BJ |
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 | } |