glibc/sysdeps/unix/sysv/linux/i386
Adhemerval Zanella 5e46749c64 Use clock_gettime to implement gettimeofday.
Consolidate generic gettimeofday implementation to use clock_gettime.
Linux ports that still provide gettimeofday through vDSO are not
changed.

Remove sysdeps/unix/clock_gettime.c, which implemented clock_gettime
using gettimeofday; new OS ports must provide a real implementation of
clock_gettime.

Rename sysdeps/mach/gettimeofday.c to sysdeps/mach/clock_gettime.c and
convert into an implementation of clock_gettime.  It only supports
CLOCK_REALTIME; Mach does not appear to have any support for monotonic
clocks.  It uses __host_get_time, which provides at best microsecond
resolution.  Hurd is currently using sysdeps/posix/clock_getres.c for
clock_getres; its output for CLOCK_REALTIME is based on
sysconf (_SC_CLK_TCK), and I do not know whether that gives the
correct result.

Unlike settimeofday, there are no known uses of gettimeofday's
vestigial "get time zone" feature that are not bugs.  (The per-process
timezone support in localtime and friends is unrelated, and the
programs that set the kernel's offset between the hardware clock and
UTC do not need to read it back.)  Therefore, this feature is dummied
out.  Henceforth, if gettimeofday's "struct timezone" argument is not
NULL, it will write zeroes to both fields.  Any program that is
actually looking at this data will thus think it is running in UTC,
which is probably more correct than whatever it was doing before.

[__]gettimeofday no longer has any internal callers, so we can now
remove its internal prototype and PLT bypass aliases.  The
__gettimeofday@GLIBC_2.0 export remains, in case it is used by any
third-party code.

It also allows to simplify the arch-specific implementation on x86 and
powerpc to remove the hack to disable the internal route to non iFUNC
variant for internal symbol.

This patch also fixes a missing optimization on aarch64, powerpc, and
x86 where the code used on static build do not use the vDSO.

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

Co-authored-by: Zack Weinberg <zackw@panix.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
2019-10-30 17:11:10 -03:00
..
i686 Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
i786
____longjmp_chk.S Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
_exit.S Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
brk.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
c++-types.data
clone.S Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
configure
configure.ac
dl-librecon.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
dl-procinfo.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
dl-sysdep.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
fxstat.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
fxstatat.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
getcontext.S Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
Implies
jmp_buf-macros.h Add jmp_buf-macros.h 2017-11-09 05:10:03 -08:00
kernel-features.h Update sysvipc kernel-features.h files for Linux 5.1 2019-10-18 11:01:13 -03:00
ld.abilist Ignore absolute symbols in ABI tests. 2018-05-04 15:46:32 +00:00
ldconfig.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
libanl.abilist Ignore absolute symbols in ABI tests. 2018-05-04 15:46:32 +00:00
libBrokenLocale.abilist Ignore absolute symbols in ABI tests. 2018-05-04 15:46:32 +00:00
libc-do-syscall.S Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
libc.abilist Finish move of clock_* functions to libc. [BZ #24959] 2019-09-04 14:39:38 +02:00
libcrypt.abilist Ignore absolute symbols in ABI tests. 2018-05-04 15:46:32 +00:00
libdl.abilist Ignore absolute symbols in ABI tests. 2018-05-04 15:46:32 +00:00
libm.abilist Make totalorder and totalordermag functions take pointer arguments. 2019-08-15 15:18:34 +00:00
libnsl.abilist Ignore absolute symbols in ABI tests. 2018-05-04 15:46:32 +00:00
libpthread.abilist nptl: Move pthread_attr_setschedparam implementation into libc 2019-10-07 20:00:38 +02:00
libresolv.abilist Ignore absolute symbols in ABI tests. 2018-05-04 15:46:32 +00:00
librt.abilist Finish move of clock_* functions to libc. [BZ #24959] 2019-09-04 14:39:38 +02:00
libthread_db.abilist Ignore absolute symbols in ABI tests. 2018-05-04 15:46:32 +00:00
libutil.abilist Ignore absolute symbols in ABI tests. 2018-05-04 15:46:32 +00:00
localplt.data
lxstat.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
makecontext.S Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
Makefile i386: Fix i386 sigaction sa_restorer initialization (BZ#21269) 2018-03-05 18:08:27 -03:00
readelflib.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
register-dump.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
setcontext.S Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
shlib-versions
sigaction.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
sigcontextinfo.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
smp.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
startup.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
swapcontext.S Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
syscall.S Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
syscalls.list
sysdep.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
sysdep.h Refactor vDSO initialization code 2019-09-17 17:09:24 -03:00
tst-bz21269.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
ucontext_i.sym
Versions
vfork.S Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
xstat.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00