File:  [Research Unix] / researchv9 / cmd / reboot.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:59 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv9-SUN3_old, researchv9-SUN3, HEAD
researchv9-SUN3(old)

#include <stdio.h>
#include <sys/reboot.h>
/*
 * Reboot
 */
static	char *sccsid = "@(#)reboot.c	4.1 (Berkeley) 10/9/80";

main(argc, argv)
	int argc;
	char **argv;
{
	int how;
	register char *argp;

	argc--, argv++;
	how = 0;
	while (argc > 0) {
		if (!strcmp(*argv, "-s"))
			how |= RB_SINGLE;
		else if (!strcmp(*argv, "-n"))
			how |= RB_NOSYNC;
		else if (!strcmp(*argv, "-a"))
			how |= RB_ASKNAME;
		else if (!strcmp(*argv, "-d"))
			how |= RB_PANIC;
		else {
			fprintf(stderr,
			    "usage: reboot [ -a ] [ -n ] [ -s ] [ -d ]\n");
			exit(1);
		}
		argc--, argv++;
	}
	reboot(how);
	perror("reboot");
}

unix.superglobalmegacorp.com

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