Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!samsung!caen!uflorida!bikini!jco From: jco@crane.cis.ufl.edu (John C. Orthoefer) Newsgroups: comp.sys.hp Subject: usleep [Re: BSD and HPUX, The Questions Continue...] Message-ID: Date: 20 May 91 14:56:05 GMT References: <1991May2.202710.5152@odin.diku.dk> <67870026@hpcupt1.cup.hp.com> <28356926.3abe@petunia.CalPoly.EDU> <1991May20.122602.6838@minyos.xx.rmit.oz.au> Sender: news@uflorida.cis.ufl.EDU Organization: /cis/santa0/jco/.organization Lines: 51 In-reply-to: s900387@minyos.xx.rmit.oz.au's message of 20 May 91 12:26:02 GMT Speaking of usleep, I need one and got desperate enough to write one, for my program that blinks the leds on the front panel of the 9k/400's. (If you want my new led blinking program send me some e-mail.) later jco ps. I'm looking for a job. /* Program: usleep.c ** Author: John C. Orthoefer ** Last edited: Wed May 15 09:09:43 1991 by jco (Dumpmaster John) on crane ** ** Works like but in no way is usleep() from SunOS. */ #include #include extern int usleep_rtn(); usleep(useconds) long useconds; { struct itimerval rttimer; struct itimerval old_rttimer; rttimer.it_value.tv_sec = 0; rttimer.it_value.tv_usec = useconds; rttimer.it_interval.tv_sec = 0; rttimer.it_interval.tv_usec = 0; signal(SIGALRM, usleep_rtn); if (setitimer (ITIMER_REAL, &rttimer, &old_rttimer)) { perror("usleep"); exit(1); } pause(); } usleep_rtn() { } -- "BSD the strongest Operating System avaible today without a prescription." John C. Orthoefer Internet: jco@smuggler.cis.ufl.edu University of Florida Floyd Mailing List: eclipse-request@reef.cis.ufl.edu CIS Department >>>>>>New Address<<<<<<-------------^^^^