glibc/time
Zack Weinberg 2b5fea833b Consolidate and deprecate ftime
ftime is an obsolete variation on gettimeofday, offering only
millisecond time resolution; it was probably a system call in ooold
versions of BSD Unix.  For historic reasons, we had three
implementations of it.  These are all consolidated into time/ftime.c,
and then the function is deprecated.

For some reason, the implementation of ftime in terms of gettimeofday
was rounding rather than truncating microseconds to milliseconds.  In
all the other places where we use a higher-resolution time function to
implement a lower-resolution one, we truncate.  ftime is changed to
match, just for tidiness' sake.

Like gettimeofday, ftime tries to report the time zone, and using that
information is always a bug.  This patch dummies out the reported
timezone information; the timezone and dstflag fields of the
returned "struct timeb" will always be zero.

Checked on x86_64-linux-gnu, i686-linux-gnu, powerpc64le-linux-gnu,
powerpc64-linux-gnu, and powerpc-linux-gnu.

Co-authored-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
2019-10-30 17:11:10 -03:00
..
bits/types time: Add padding for the timespec if required 2019-10-01 14:56:06 -07:00
sys Consolidate and deprecate ftime 2019-10-30 17:11:10 -03:00
adjtime.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
alt_digit.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
asctime.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
bug-asctime_r.c [BZ #1468] 2005-10-14 17:20:58 +00:00
bug-asctime.c [BZ #1460] 2005-10-14 15:17:40 +00:00
bug-getdate1.c support: Introduce new subdirectory for test infrastructure 2016-12-09 08:18:27 +01:00
bug-mktime1.c [BZ #2821] 2006-09-09 16:56:29 +00:00
bug-mktime4.c mktime: new test for mktime failure 2018-11-15 22:59:33 +01:00
clock_getcpuclockid.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
clock_getres.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
clock_gettime.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
clock_nanosleep.c time: Introduce function to check correctness of nanoseconds value 2019-10-27 21:49:25 +01:00
clock_settime.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
clock.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
clocktest.c Add missing header files throughout the testsuite. 2017-02-16 17:33:18 -05:00
ctime_r.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
ctime.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
datemsk * time/Makefile (tst-getdate-ENV): Add TZDIR to environment. 2001-07-18 09:43:36 +00:00
Depend * time/Makefile (tst-getdate-ENV): Add TZDIR to environment. 2001-07-18 09:43:36 +00:00
difftime.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
dysize.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
era.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
ftime.c Consolidate and deprecate ftime 2019-10-30 17:11:10 -03:00
getdate.c Change most internal uses of time to __clock_gettime. 2019-10-30 17:11:10 -03:00
getitimer.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
gettimeofday.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
gmtime.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
lc-time-cleanup.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
localtime.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
Makefile Use clock_settime to implement settimeofday. 2019-10-30 17:05:14 -03:00
mktime-internal.h Make mktime etc. compatible with __time64_t 2019-04-30 09:02:17 -07:00
mktime.c Make mktime etc. compatible with __time64_t 2019-04-30 09:02:17 -07:00
offtime.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
setitimer.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
settimeofday.c Use clock_settime to implement settimeofday. 2019-10-30 17:05:14 -03:00
settimezone.c Use clock_settime to implement settimeofday. 2019-10-30 17:05:14 -03:00
stime.c Use clock_settime to implement stime; withdraw stime. 2019-10-30 17:05:14 -03:00
strftime_l.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
strftime.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
strptime_l.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
strptime.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
test_time.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
time.c Change most internal uses of time to __clock_gettime. 2019-10-30 17:11:10 -03:00
time.h Use clock_settime to implement stime; withdraw stime. 2019-10-30 17:05:14 -03:00
timegm.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
timespec_get.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
tst_wcsftime.c Don't use the argument to time. 2019-08-21 08:26:36 -04:00
tst-clock2.c Finish move of clock_* functions to libc. [BZ #24959] 2019-09-04 14:39:38 +02:00
tst-clock_nanosleep.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
tst-clock.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
tst-cpuclock1.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
tst-ftime_l.c Modify several tests to use test-skeleton.c 2014-11-05 15:24:08 +05:30
tst-ftime.c Consolidate and deprecate ftime 2019-10-30 17:11:10 -03:00
tst-getdate.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
tst-mktime2.c time/tst-mktime2: Improve test error reporting 2018-10-23 11:25:05 +02:00
tst-mktime3.c Modify several tests to use test-skeleton.c 2014-11-05 15:24:08 +05:30
tst-mktime.c Modify several tests to use test-skeleton.c 2014-11-05 15:24:08 +05:30
tst-posixtz.c Add missing header files throughout the testsuite. 2017-02-16 17:33:18 -05:00
tst-strftime2.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
tst-strftime3.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
tst-strftime.c Fix BZ #18985 -- out of range data to strftime() causes a segfault 2015-09-26 13:27:48 -07:00
tst-strptime2.c Split DIAG_* macros to new header libc-diag.h. 2017-02-25 09:59:46 -05:00
tst-strptime3.c time: ensure failing strptime() tests are reported correctly 2015-03-06 06:06:26 -05:00
tst-strptime-whitespace.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
tst-strptime.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
tst-tzname.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
tst-y2039.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
tzfile.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
tzset.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
Versions Finish move of clock_* functions to libc. [BZ #24959] 2019-09-04 14:39:38 +02:00
wcsftime_l.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
wcsftime.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00