Article View: comp.bugs.sys5
Article #345napms bug in SVR3 fixed in SVR4 ?
From: Tim Atchison
Date: Thu, 31 Jan 1991 20:53
Date: Thu, 31 Jan 1991 20:53
84 lines
2740 bytes
2740 bytes
In SVR3, on some machines including the 3b2 and other ATT/SYS5 based machines
the library function "napms" doesn't work.
The following program proves this problem:
-------------- CUT HERE ! ------------------------------------------------------
#include "stdio.h"
#include "sys/param.h"
main ()
{
long usPerTick = 1000000 / HZ;
long usPerCall;
long st;
long et;
int waitTime;
long iterations;
long totalMicroSeconds;
long i;
totalMicroSeconds = 30000000; /* 30 sec */
waitTime = usPerTick / 1000;
printf ("Testing napms timeout for approx 30 seconds ...\n");
st = time (NULL);
iterations = 0;
for (i = totalMicroSeconds ; i > 0; i = i - usPerTick)
{
napms (waitTime);
iterations++;
}
et = time (NULL) - st;
usPerCall = (et * 1000000) / iterations;
printf ("Elapsed time was %ld seconds for %ld iterations.\n",
et, iterations);
printf ("Clock ticks every %ld.%03d milliseconds.\n",
usPerTick / 1000, usPerTick % 1000);
printf ("napms time is %d.%02d milliseconds.\n",
usPerCall / 1000, usPerCall % 1000);
}
-------------- CUT HERE ! ------------------------------------------------------
On machines where this doesn't work (ATT 3b2/600) you get the following
output:
Testing napms timeout for approx 30 seconds ...
Elapsed time was 0 seconds for 3000 iterations.
Clock ticks every 10.000 milliseconds.
napms time is 0.00 milliseconds.
On machines where this works (IBM RS/6000) you get the following
output:
Testing napms timeout for approx 30 seconds ...
Elapsed time was 31 seconds for 3000 iterations.
Clock ticks every 10.000 milliseconds.
napms time is 10.333 milliseconds.
Can anyone get me the source for napms that works ? If not, can any
steer me in a direction as to fixes and/or workarounds ?
Thanks, and please email me directly.
Timothy M. Atchison UUCP: mit-eddie!progress!tma
Progress Software Corp. Internet: tma@progress.com
5 Oak Park
Bedford, MA 01730
--
Timothy M. Atchison UUCP: mit-eddie!progress!tma
Progress Software Corp. Internet: tma@progress.com
5 Oak Park
Bedford, MA 01730
Technical Details
Message-ID:
<1991Jan31.205324.11667@progress.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!att!linac!uwm.edu!spool.mu.edu!think.com!linus!progress!tmaShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!att!linac!uwm.edu!spool.mu.edu!think.com!linus!progress!tma From: tma@progress.COM (Tim Atchison) Newsgroups: comp.bugs.sys5 Subject: napms bug in SVR3 fixed in SVR4 ? Summary: napms bug in SVR3 fixed in SVR4 ? Keywords: napms bug in SVR3 fixed in SVR4 ? Message-ID: <1991Jan31.205324.11667@progress.com> Date: 31 Jan 91 20:53:24 GMT Sender: news@progress.com (The News User) Organization: Progress Software Corp., Bedford, MA Lines: 84 Nntp-Posting-Host: ericf