minix/commands/update/update.c
Ben Gras 6a73e85ad1 retire _PROTOTYPE
. only good for obsolete K&R support
	. also remove a stray ansi.h and the proto cmd
2012-03-25 16:17:10 +02:00

25 lines
404 B
C

/* update - do sync periodically Author: Andy Tanenbaum */
#include <sys/types.h>
#include <signal.h>
#include <unistd.h>
int main(void);
int main()
{
/* Release all (?) open file descriptors. */
close(0);
close(1);
close(2);
/* Release current directory to avoid locking current device. */
chdir("/");
/* Flush the cache every 30 seconds. */
while (1) {
sync();
sleep(30);
}
}