Go to file
Adhemerval Zanella 72e84d1db2 Linux: Use 32-bit vDSO for clock_gettime, gettimeofday, time (BZ# 28071)
The previous approach defeats the vDSO optimization on older kernels
because a failing clock_gettime64 system call is performed on every
function call.  It also results in a clobbered errno value, exposing
an OpenJDK bug (JDK-8270244).

This patch fixes by open-code INLINE_VSYSCALL macro and replace all
INLINE_SYSCALL_CALL with INTERNAL_SYSCALL_CALLS.  Now for
__clock_gettime64x, the 64-bit vDSO is used and the 32-bit vDSO is
tried before falling back to 64-bit syscalls.

The previous code preferred 64-bit syscall for the case where the kernel
provides 64-bit time_t syscalls *and* also a 32-bit vDSO (in this case
the *64-bit* syscall should be preferable over the vDSO).  All
architectures that provides 32-bit vDSO (i386, mips, powerpc, s390)
modulo sparc; but I am not sure if some kernels versions do provide
only 32-bit vDSO while still providing 64-bit time_t syscall.
Regardless, for such cases the 64-bit time_t syscall is used if the
vDSO returns overflowed 32-bit time_t.

Tested on i686-linux-gnu (with a time64 and non-time64 kernel),
x86_64-linux-gnu.  Built with build-many-glibcs.py.

Co-authored-by: Florian Weimer <fweimer@redhat.com>
2021-07-12 17:37:56 -03:00
ChangeLog.old
argp
assert
benchtests
bits
catgets
conform
crypt
csu Force building with -fno-common 2021-07-09 20:09:14 +02:00
ctype
debug
dirent
dlfcn elf: Clean up GLIBC_PRIVATE exports of internal libdl symbols 2021-07-07 08:41:24 +02:00
elf Force building with -fno-common 2021-07-09 20:09:14 +02:00
gmon
gnulib
grp
gshadow
hesiod
htl
hurd
iconv libio: Replace internal _IO_getdelim symbol with __getdelim 2021-07-07 18:33:52 +02:00
iconvdata
include Reduce <limits.h> pollution due to dynamic PTHREAD_STACK_MIN 2021-07-12 18:43:32 +02:00
inet inet: Add hidden prototype for __inet_network 2021-07-07 18:33:52 +02:00
intl
io io: Add closefrom [BZ #10353] 2021-07-08 14:08:14 -03:00
libio libio: Replace internal _IO_getdelim symbol with __getdelim 2021-07-07 18:33:52 +02:00
locale
localedata
login
mach
malloc Force building with -fno-common 2021-07-09 20:09:14 +02:00
manual Define PTHREAD_STACK_MIN to sysconf(_SC_THREAD_STACK_MIN) 2021-07-09 15:10:35 -07:00
math
mathvec
misc Force building with -fno-common 2021-07-09 20:09:14 +02:00
nis nis: nis_local_group may read from __nisgroup[-1] (bug 28075) 2021-07-12 07:58:07 +02:00
nptl Reduce <limits.h> pollution due to dynamic PTHREAD_STACK_MIN 2021-07-12 18:43:32 +02:00
nptl_db
nscd
nss Fix failing nss/tst-nss-files-hosts-long. 2021-07-12 11:59:04 +02:00
po
posix Properly run tst-spawn5 directly [BZ #28067] 2021-07-09 06:37:51 -07:00
pwd
resolv Force building with -fno-common 2021-07-09 20:09:14 +02:00
resource
rt
scripts build-many-glibcs.py: Add glibcs-arm-linux-gnueabihf-thumb 2021-07-09 10:59:22 +02:00
setjmp
shadow
signal
socket
soft-fp soft-fp: Add __extendhfsf2/__extendhfdf2, __truncsfhf2/__truncdfhf2, __eqhf2/__nehf2 2021-07-07 08:01:32 -07:00
stdio-common libio: Replace internal _IO_getdelim symbol with __getdelim 2021-07-07 18:33:52 +02:00
stdlib Define PTHREAD_STACK_MIN to sysconf(_SC_THREAD_STACK_MIN) 2021-07-09 15:10:35 -07:00
string
sunrpc Force building with -fno-common 2021-07-09 20:09:14 +02:00
support support: Replace _SC_MINSIGSTKSZ with _SC_SIGSTKSZ 2021-07-11 07:57:31 -07:00
sysdeps Linux: Use 32-bit vDSO for clock_gettime, gettimeofday, time (BZ# 28071) 2021-07-12 17:37:56 -03:00
sysvipc
termios
time
timezone
wcsmbs
wctype
.gitattributes
.gitignore
COPYING
COPYING.LIB
INSTALL
LICENSES
MAINTAINERS
Makeconfig Force building with -fno-common 2021-07-09 20:09:14 +02:00
Makefile
Makefile.help
Makefile.in
Makerules
NEWS Define PTHREAD_STACK_MIN to sysconf(_SC_THREAD_STACK_MIN) 2021-07-09 15:10:35 -07:00
README
Rules
abi-tags
aclocal.m4
config.h.in
config.make.in
configure
configure.ac
extra-lib.mk
gen-locales.mk
libc-abis
libof-iterator.mk
o-iterator.mk
shlib-versions
test-skeleton.c
version.h

README

This directory contains the sources of the GNU C Library.
See the file "version.h" for what release version you have.

The GNU C Library is the standard system C library for all GNU systems,
and is an important part of what makes up a GNU system.  It provides the
system API for all programs written in C and C-compatible languages such
as C++ and Objective C; the runtime facilities of other programming
languages use the C library to access the underlying operating system.

In GNU/Linux systems, the C library works with the Linux kernel to
implement the operating system behavior seen by user applications.
In GNU/Hurd systems, it works with a microkernel and Hurd servers.

The GNU C Library implements much of the POSIX.1 functionality in the
GNU/Hurd system, using configurations i[4567]86-*-gnu.

When working with Linux kernels, this version of the GNU C Library
requires Linux kernel version 3.2 or later.

Also note that the shared version of the libgcc_s library must be
installed for the pthread library to work correctly.

The GNU C Library supports these configurations for using Linux kernels:

	aarch64*-*-linux-gnu
	alpha*-*-linux-gnu
	arc*-*-linux-gnu
	arm-*-linux-gnueabi
	csky-*-linux-gnuabiv2
	hppa-*-linux-gnu
	i[4567]86-*-linux-gnu
	x86_64-*-linux-gnu	Can build either x86_64 or x32
	ia64-*-linux-gnu
	m68k-*-linux-gnu
	microblaze*-*-linux-gnu
	mips-*-linux-gnu
	mips64-*-linux-gnu
	powerpc-*-linux-gnu	Hardware or software floating point, BE only.
	powerpc64*-*-linux-gnu	Big-endian and little-endian.
	s390-*-linux-gnu
	s390x-*-linux-gnu
	riscv32-*-linux-gnu
	riscv64-*-linux-gnu
	sh[34]-*-linux-gnu
	sparc*-*-linux-gnu
	sparc64*-*-linux-gnu

If you are interested in doing a port, please contact the glibc
maintainers; see https://www.gnu.org/software/libc/ for more
information.

See the file INSTALL to find out how to configure, build, and install
the GNU C Library.  You might also consider reading the WWW pages for
the C library at https://www.gnu.org/software/libc/.

The GNU C Library is (almost) completely documented by the Texinfo manual
found in the `manual/' subdirectory.  The manual is still being updated
and contains some known errors and omissions; we regret that we do not
have the resources to work on the manual as much as we would like.  For
corrections to the manual, please file a bug in the `manual' component,
following the bug-reporting instructions below.  Please be sure to check
the manual in the current development sources to see if your problem has
already been corrected.

Please see https://www.gnu.org/software/libc/bugs.html for bug reporting
information.  We are now using the Bugzilla system to track all bug reports.
This web page gives detailed information on how to report bugs properly.

The GNU C Library is free software.  See the file COPYING.LIB for copying
conditions, and LICENSES for notices about a few contributions that require
these additional notices to be distributed.  License copyright years may be
listed using range notation, e.g., 1996-2015, indicating that every year in
the range, inclusive, is a copyrightable year that would otherwise be listed
individually.