Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!linus!philabs!cmcl2!seismo!brl-tgr!gwyn From: gwyn@brl-tgr.ARPA (Doug Gwyn ) Newsgroups: net.unix-wizards Subject: Re: sub-second sleeps on BSD 4.2 Message-ID: <10186@brl-tgr.ARPA> Date: Wed, 24-Apr-85 13:27:16 EST Article-I.D.: brl-tgr.10186 Posted: Wed Apr 24 13:27:16 1985 Date-Received: Fri, 26-Apr-85 22:16:45 EST References: <408@psivax.UUCP> Organization: Ballistic Research Lab Lines: 13 > void nullfunc(){ > wakeup = 1; > } > ... > signal(SIGALRM, nullfunc); Sometimes the signal will fire HERE, ... > wakeup = 0; > if(setitimer(ITIMER_REAL, &tm, NULL)) exit(1); > while(wakeup == 0) sigpause(0); ... so you won't see it here. The simplest way to get sub-second naps on 4.2BSD is to do a select() specifying no file descriptors and a small timeout.