if (system == NULL) system = _PATH_UNIX;
main(int argc, char **argv){	extern char *optarg;	extern int optind;	int ch, mode, disp, accessmode;	struct kvmvars kvmvars;	char *system, *kmemf;	seteuid(getuid());	kmemf = NULL;	system = NULL;	while ((ch = getopt(argc, argv, "M:N:bhpr")) != -1) {		switch((char)ch) {		case 'M':			kmemf = optarg;			kflag = 1;			break;		case 'N':			system = optarg;			break;		case 'b':			bflag = 1;			break;		case 'h':			hflag = 1;			break;		case 'p':			pflag = 1;			break;		case 'r':			rflag = 1;			break;		default:			(void)fprintf(stderr,			    "usage: kgmon [-bhrp] [-M core] [-N system]\n");			exit(1);		}	}	argc -= optind;	argv += optind;#define BACKWARD_COMPATIBILITY#ifdef	BACKWARD_COMPATIBILITY	if (*argv) {		system = *argv;		if (*++argv) {			kmemf = *argv;			++kflag;		}	}#endif	if (system == NULL)		system = _PATH_UNIX;	accessmode = openfiles(system, kmemf, &kvmvars);	mode = getprof(&kvmvars);	if (hflag)		disp = GMON_PROF_OFF;	else if (bflag)		disp = GMON_PROF_ON;	else		disp = mode;	if (pflag)		dumpstate(&kvmvars);	if (rflag)		reset(&kvmvars);	if (accessmode == O_RDWR)		setprof(&kvmvars, disp);	(void)fprintf(stdout, "kgmon: kernel profiling is %s.\n",		      disp == GMON_PROF_OFF ? "off" : "running");	return (0);}