[NTLUG:Discuss] times(2)
George E. Lass
George.Lass at osc.com
Wed Feb 2 14:30:53 CST 2000
Jonathan Miller wrote:
>
> This is a known bug. I actually thought it caused the machine to crash,
> but whatever. I thought it was fixed in 2.2.
>
> -- Jonathan
>
Johnathan,
Is there some place that I can find out about the "times" problem
as well as other "known" bugs? I'm using Linux to drive a long
distance telephone switch and would like to see if there are
other problems lurking in the background.
One of my co-workers is running 2.2.14 at home and took a look
at his source code, and it looks like the bug is still there.
His system is a long way from being up for the 248 days it takes
to generate the problem, so we are not sure that 2.2.14 has the
problem, but it looks like it does.
Finally, thru observation we have determined that once the problem
happens (indicated by times returning 0xffffffff) errno contains
a "fudge factor" that can be used to determine the number of ticks:
abs_ticks = times(&proc_time); /* get ms since O/S restart */
if(abs_ticks == -1) /* been up too long.... */
{
adj_ticks = 0x80000000 - errno;
adj_ticks += 0x80000000;
abs_ticks = adj_ticks;
}
Although we can't seem to figure out how/where errno is being
set, the above seems to work......
George
--
... Unix IS a user friendly O/S ...
(It's just picky about its friends)
More information about the Discuss
mailing list