Re: ftime() not giving miliseconds?

Guest section DW (dwguest@win.tue.nl)
Tue, 11 May 1999 00:30:14 +0200 (MET DST)


This has nothing to do with linux-kernel.
The routine ftime is obsolete, but inspection of its source
shows

timebuf->millitm = 0;

(in sysdeps/generic/ftime.c).
The more desirable

timebuf->millitm = (tv.tv_usec + 999) / 1000;

is found only in sysdeps/unix/bsd/ftime.c,
while linux uses the buggy generic version.

So, I updated the man page:

...

BUGS
Under libc4 and libc5 the millitm field is meaningful.
But glibc2 is buggy and returns 0 there.

HISTORY
The ftime function appeared in 4.2BSD.
...

Andries

[Indeed, a random libc4 machine (with Linux 1.2.11) says
# ./timebug
It's now 926378129.583
It's now 926378129.605
]

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/