int main(int argc, char *argv[])
{
	unsigned int adapter = 0, frontend = 0, count = 0;
	int human_readable = 0;
	int opt;

       while ((opt = getopt(argc, argv, "rAHa:f:c:")) != -1) {
		switch (opt)
		{
		default:
			usage();
			break;
		case 'a':
			adapter = strtoul(optarg, NULL, 0);
			break;
		case 'c':
			count = strtoul(optarg, NULL, 0);
			break;
		case 'f':
			frontend = strtoul(optarg, NULL, 0);
			break;
		case 'H':
			human_readable = 1;
			break;
		case 'A':
			// Acoustical mode: we have to reduce the delay between
			// checks in order to hear nice sound
			sleep_time=5000;
			acoustical_mode=1;
			break;
		case 'r':
			remote=1;
			break;
		}
	}

	do_mon(adapter, frontend, human_readable, count);

	return 0;
}
Beispiel #2
0
int main(int argc, char **argv)
{
	pid_t pid;

	if (check_action() != ACT_IDLE) {	// Don't execute during upgrading
		printf("check_ps: nothing to do...\n");
		return 1;
	}

	pid = fork();
	switch (pid) {
	case -1:
		perror("fork failed");
		exit(1);
		break;
	case 0:
		do_mon();
		exit(0);
		break;
	default:
		_exit(0);
		break;
	}
}
int
do_writemon_mon(void)
{
    return(do_mon(0));
}
int
do_dispmon_mon(void)
{
    return(do_mon(1));
}