Bug 60350

Summary: ftime millisecond rollover off by one
Product: [Retired] Red Hat Linux Reporter: ae
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED ERRATA QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: fweimer
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-03-04 15:48:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description ae 2002-02-26 12:05:55 UTC
RHL 7.2, glibc-2.2.4-19.3

Code snippet:

  struct timeb T;
  ftime (&T);
  printf ("%d\n", T.millitm);

will sometimes produce value 1000.  This isn't in explicit conflict
with 'man ftime' but it is surprising and not what you'd
expect from the 'millitm' name.

For comparison, here's a paragraph from 'man ftime' on Solaris 8:

     The time and millitm members contain the  seconds  and  mil-
     liseconds  portions,  respectively,  of  the current time in
     seconds since 00:00:00  UTC  (Coordinated  Universal  Time),
     January 1, 1970.

Comment 2 Jakub Jelinek 2002-04-05 09:04:16 UTC
Fixed in glibc-2.2.4-24.