File:  [MW Coherent from dump] / coherent / b / kernel / tools / naptest.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:37 2019 UTC (7 years ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent

/* naptest.c */

#include <signal.h>

int bleep;

void
intHandler()
{
	bleep = 1;
}

main(argc, argv)
int argc;
char * argv[];
{
	int naptime, result;

	if (argc <= 1)
		printf("Usage: %s <nap-interval-in-milliseconds>\n", argv[0]);
	else {
		sigset(SIGINT, intHandler);
		naptime = atoi(argv[1]);
		printf("Napping for %d msec.\n", naptime);
		result = nap(naptime);
		if (bleep)
			printf("SIGINT received\n");
		if (result == -1)
			perror("Nap test error");
		else
			printf("Nap over.  Slept for %d msec.\n", result);
	}
}

unix.superglobalmegacorp.com

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