File:  [CSRG BSD Unix] / 43BSDReno / usr.sbin / update / update.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:57 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43reno
BSD 4.3reno

/*
 * Copyright (c) 1987, 1990 Regents of the University of California.
 * All rights reserved.  The Berkeley software License Agreement
 * specifies the terms and conditions for redistribution.
 */

#ifndef lint
static char sccsid[] = "@(#)update.c	4.5 (Berkeley) 6/29/90";
#endif

/*
 * Update the file system every 30 seconds.
 * For cache benefit, open certain system directories.
 */

#include <sys/time.h>
#include <sys/file.h>
#include <sys/signal.h>
#include "pathnames.h"

main()
{
	struct itimerval value;
	register char **f;
	extern int sync();

	daemon(0, 0);
	for (f = fillst; *f; f++)
		(void)open(*f, O_RDONLY, 0);
	(void)signal(SIGALRM, sync);
	value.it_interval.tv_sec = 30;
	value.it_interval.tv_usec = 0;
	value.it_value = value.it_interval;
	if (setitimer(ITIMER_REAL, &value, (struct itimerval *)NULL)) {
		perror("update: setitimer");
		exit(1);
	}
	for (;;)
		pause();
	/*NOTREACHED*/
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.