source: trunk/minix/commands/simple/update.c@ 11

Last change on this file since 11 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 418 bytes
RevLine 
[9]1/* update - do sync periodically Author: Andy Tanenbaum */
2
3#include <sys/types.h>
4#include <signal.h>
5#include <unistd.h>
6
7_PROTOTYPE(int main, (void));
8
9int main()
10{
11 /* Release all (?) open file descriptors. */
12 close(0);
13 close(1);
14 close(2);
15
16 /* Release current directory to avoid locking current device. */
17 chdir("/");
18
19 /* Flush the cache every 30 seconds. */
20 while (1) {
21 sync();
22 sleep(30);
23 }
24}
Note: See TracBrowser for help on using the repository browser.