Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site men1.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!whuxlm!harpo!decvax!linus!philabs!cmcl2!seismo!umcp-cs!prometheus!men1!ron From: ron@men1.UUCP (Ron Flax) Newsgroups: net.bugs.uucp Subject: Re: 4.2 uucp performance problems? Message-ID: <374@men1.UUCP> Date: Fri, 15-Feb-85 15:14:21 EST Article-I.D.: men1.374 Posted: Fri Feb 15 15:14:21 1985 Date-Received: Mon, 18-Feb-85 06:29:50 EST References: <1363@hao.UUCP> <13500001@uicsl.UUCP> <442@down.FUN> Organization: MTACCS Engineering Network, Arlington VA Lines: 40 >> Is it possible to get the "nap()" call code? >> We cannot do sub-second sleeps. >> >> Or is this V5 stuff ?? >> Or is this 4.2bsd buried somewhere?? >> >> b.c.mather >> uiucdcs!uicsl!mather > > /* "sleep" for n clock ticks */ > #include > nap(n) > { > struct timeval t; > > if (n <= 0 || n > 3000) > return; /* unreasonable */ > t.tv_sec = n / 60; > t.tv_usec = ((n % 60) * 1000000) / 60; > (void) select(32, 0, 0, 0, &t); > } > > this assumes a 60 hz clock. your mileage may vary. > > peter [ Replace this MUNGE with your MUNGE ] Peter I think you forgot something?? This code is great if you happen to have the 'select' system call... ...which I believe is a 4.2bsd system call. Ron@men1 (Ron Flax) MTACCS Engineering Network ..!{seismo,umcp-cs}!{prometh,cal-unix}!men1!ron "The opinions expressed herein are mine only if you agree with them."