Bug 683
Summary: | ftime millitm always returns 0 | ||
---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | whampton |
Component: | glibc | Assignee: | Cristian Gafton <gafton> |
Status: | CLOSED NOTABUG | QA Contact: | |
Severity: | low | Docs Contact: | |
Priority: | low | ||
Version: | 5.2 | CC: | whampton |
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: | 1999-01-04 23:54:35 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
whampton
1999-01-04 16:24:19 UTC
I have verified this report to be true. I compile the included code and observed the difference on a 4.2 machine and a 5.2 machine. It has been assigned to a developer for further review. According to Single Unix Spec ver 2: ===QUOTE=== SYNOPSIS #include <sys/timeb.h> int ftime(struct timeb *tp); DESCRIPTION The ftime() function sets the time and millitm members of the timeb structure pointed to by tp to contain the seconds and milliseconds portions, respectively, of the current time in seconds since 00:00:00 UTC (Coordinated Universal Time), January 1, 1970. The contents of the timezone and dstflag members of tp after a call to ftime() are unspecified. The system clock need not have millisecond granularity. Depending on any granularity (particularly a granularity of one) renders code non-portable. ===END QUOTE=== For guaranteed granularity one should use gettimeofday() instead of ftime. I have verified that this bug still exists in RedHat version 6.0 package glibc-2.1.1-6-i386 by compiling and executing the given code. Re-opening bug. |