File:  [CSRG BSD Unix] / 40BSD / cmd / reboot.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:53 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD40
BSD 4.0

#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 howto;
	register char *argp;

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

unix.superglobalmegacorp.com

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