public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/zack/y2038-preliminaries] (17 commits) Linux/Alpha: don’t use timeval32 system calls.
@ 2019-08-20 12:07 Zack Weinberg
0 siblings, 0 replies; only message in thread
From: Zack Weinberg @ 2019-08-20 12:07 UTC (permalink / raw)
To: glibc-cvs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 57261 bytes --]
The branch 'zack/y2038-preliminaries' was updated to point to:
61120e4... Linux/Alpha: donât use timeval32 system calls.
It previously pointed to:
c6213d1... Linux/Alpha: donât use timeval32 system calls.
Diff:
!!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST):
-------------------------------------------------------------------
c6213d1... Linux/Alpha: donât use timeval32 system calls.
ae59faf... Warn when gettimeofday is called with non-null tzp argument
00caaff... Finish move of clock_* functions to libc.
7fffb65... Revise the documentation of âsimple calendar timeâ.
33487ef... Use clock_gettime to implement gettimeofday.
fcc009b... Use clock_gettime to implement ftime.
c93d073... Use clock_gettime to implement time.
79d24b6... Use clock_settime to implement settimeofday.
6df4704... Use clock_settime to implement stime.
e0c5b81... Donât use the argument to time.
2945aad... Change most internal uses of __gettimeofday to __clock_gett
0a84fe5... Remove implementations of clock_[gs]ettime using [gs]ettime
commit c6213d1a529fe8aebbd3b80dc6c775a6fe7090a9
Author: Zack Weinberg <zackw@panix.com>
Date: Mon Aug 19 14:18:08 2019 -0400
Linux/Alpha: donât use timeval32 system calls.
Linux/Alpha has two versions of several system call wrappers that take
or return data of type âstruct timevalâ (possibly nested inside a
larger structure). The GLIBC_2.0 version is a compat symbol that
calls __NR_osf_foo or __NR_old_foo and uses a struct timeval with a
32-bit tv_sec field. The GLIBC_2.1 version is used for current code,
calls __NR_foo, and uses a struct timeval with a 64-bit tv_sec field.
This patch changes all of the remaining compat symbols of this type to
be wrappers around their GLIBC_2.1 counterparts. (gettimeofday
already received this treatment in an earlier patch in this series.)
The compat symbols that copy out a 32-bit struct timeval all check for
overflow. After the Y2038 deadline, they will fail with errno set to
EOVERFLOW, but only after copying out as much as they can, and filling
in the overflowed âstruct timevalâ(s) with tv_sec set to INT32_MAX and
tv_nsec set to zero.
The new header file tv32-compat.h is currently Alpha-specific but I
donât know any reason why it couldnât be reused to aid in writing
wrappers for all affected architectures.
* sysdeps/unix/sysv/linux/alpha/tv32-compat.h: New file declaring
types and helper functions for 32/64-bit time_t conversion.
* sysdeps/unix/sysv/linux/alpha/syscalls.list: Remove entries for
osf_getitimer, osf_setitimer, osf_utimes, osf_getrusage, and osf_wait4.
* sysdeps/unix/sysv/linux/alpha/osf_getitimer.c
* sysdeps/unix/sysv/linux/alpha/osf_getrusage.c
* sysdeps/unix/sysv/linux/alpha/osf_setitimer.c
* sysdeps/unix/sysv/linux/alpha/osf_utimes.c
* sysdeps/unix/sysv/linux/alpha/osf_wait4.c:
New files defining compatibility symbols formerly defined by
alpha/syscalls.list.
* sysdeps/unix/sysv/linux/alpha/adjtime.c: Split the compat code to...
* sysdeps/unix/sysv/linux/alpha/osf_adjtime.c: ...this new file.
* sysdeps/unix/sysv/linux/alpha/Makefile (sysdep_routines):
Add osf_adjtime.
* sysdeps/unix/sysv/linux/alpha/osf_gettimeofday.c
* sysdeps/unix/sysv/linux/alpha/osf_settimeofday.c:
Use tv32-compat.h helpers.
commit ae59faf5104469fcc5c3a46f55777a1ead966313
Author: Zack Weinberg <zackw@panix.com>
Date: Mon Aug 19 13:51:25 2019 -0400
Warn when gettimeofday is called with non-null tzp argument.
At this stage I donât think we can issue warnings for settimeofday
with a non-null tzp argument, nor for arbitrary use of struct
timezone. But we can warn about gettimeofday with non-null tzp.
This uses a macro instead of an inline (fortify-style) function
because I got false positives with an inline, even with GCC 9.
* time/sys/time.h (__timezone_ptr_t): Delete.
(gettimeofday): Always declare second argument with type âvoid *â.
When possible, wrap with a macro that detects non-null and
non-constant second argument and issues a warning.
Improve commentary.
(settimeofday): Improve commentary.
* time/gettimeofday.c (gettimeofday):
Declare second argument as type âvoid *â.
commit 00caaffbda06f48a4dda3e3dbf9c029628e138a2
Author: Zack Weinberg <zackw@panix.com>
Date: Mon Aug 19 12:25:14 2019 -0400
Finish move of clock_* functions to libc.
In glibc 2.17, the functions clock_getcpuclockid, clock_getres,
clock_gettime, clock_nanosleep, and clock_settime were moved from
librt.so to libc.so, leaving compatibility stubs behind. Now that the
dynamic linker no longer insists on finding versioned symbols in the
same library that originally defined them, we do not need the stubs
anymore, and this means we donât need GLIBC_PRIVATE __-prefix aliases for
most of the functions anymore either. (clock_gettime is still called
all over the place internally and therefore still needs one.)
While Iâm at it, move the clock_*.c files and their tests from rt/ to
time/.
* rt/clock-compat.c: Delete file.
* rt/clock_getcpuclockid.c: Move to time/clock_getcpuclockid.c.
* rt/clock_getres.c: Move to time/clock_getres.c.
* rt/clock_gettime.c: Move to time/clock_gettime.c.
* rt/clock_nanosleep.c: Move to time/clock_nanosleep.c.
* rt/clock_settime.c: Move to time/clock_settime.c.
* rt/tst-clock.c: Move to time/tst-clock.c.
* rt/tst-clock2.c: Move to time/tst-clock2.c.
* rt/tst-clock_nanosleep.c: Move to time/tst-clock_nanosleep.c.
* rt/tst-cpuclock1.c: Move to time/tst-cpuclock1.c.
* include/time.h: Remove internal prototypes for __clock_getres,
__clock_nanosleep, and __clock_getcpuclockid.
* rt/Makefile (routines, clock-routines): Delete.
(librt-routines): Remove clock-compat.
(tests): Remove tst-clock, tst-clock2, tst-clock_nanosleep, and
tst-cpuclock1.
* time/Makefile (routines): Add clock_getcpuclockid, clock_getres,
clock_gettime, clock_settime, and clock_nanosleep.
(tests): Add tst-clock, tst-clock2, tst-clock_nanosleep, and
tst-cpuclock1.
* rt/Versions (libc GLIBC_PRIVATE): Remove __clock_getres,
__clock_settime, __clock_getcpuclockid, and __clock_nanosleep.
(librt GLIBC_2.2): Remove clock_getres, clock_gettime,
clock_settime, clock_getcpuclockid, and clock_nanosleep.
* sysdeps/**/librt.abilist: Update to match.
commit 7fffb650ac614f38ccbc7f05b461ff6db2324418
Author: Zack Weinberg <zackw@panix.com>
Date: Mon Aug 19 10:31:07 2019 -0400
Revise the documentation of âsimple calendar timeâ.
This is a thorough revision of all the material relating to the
functions time, stime, gettimeofday, settimeofday, clock_gettime,
clock_getres, clock_settime, and difftime, spilling over into the
discussion of time-related data types (which now get their own
section) and touching the adjtime family as well (which deserves its
own thorough revision, but Iâd have to do a bunch of research first).
Substantive changes are:
* Document clock_gettime, clock_getres, and clock_settime. (Only
CLOCK_REALTIME and CLOCK_MONOTONIC are documented; the others are
either a bit too Linux-specific, or have more to do with measuring
CPU/processor time. That section _also_ deserves its own thorough
revision but again Iâd have to do a bunch of research first.)
* Present gettimeofday, settimeofday, and struct timeval as obsolete
relative to clock_*.
* Remove the documentation of struct timezone. Matching POSIX,
say that the type of the second argument to gettimeofday and
settimeofday is [const] void *.
* Clarify ISO C and POSIXâs requirements on time_t. Clarify the
circumstances under which difftime is equivalent to simple
subtraction.
* Consolidate documentation of most of the time-related data types
into a new section âTime Types,â right after âTime Basics.â (The
exceptions are struct tm, which stays in âBroken-down Time,â and
struct times, which stays in âProcessor And CPU Time.â
* The âElapsed Timeâ section is now called âCalculating Elapsed Timeâ
and includes only difftime and the discussion of how to compute
timeval differences by hand.
* Fold the âSimple Calendar Time,â âHigh Resolution Calendar,â and
âHigh Accuracy Clockâ sections together into two new sections titled
âGetting the Timeâ and âSetting and Adjusting the Time.â
ChangeLog:
* manual/time.texi: Major revision of text related to simple
calendar time. clock_gettime, clock_getres, and clock_settime
are now documented.
* manual/filesys.texi, manual/llio.texi, manual/threads.texi:
Update cross-references to renamed sections in time.texi.
Large blocks of text are moved around, so the diff is not terribly
informative; reviewers may find it easier to apply the diff and then
read the changed sections of the rendered manual.
The NEWS update in this patch corresponds to the previous substantive
changes.
commit 33487ef53eb37e49701fb808139db8adf85cff4a
Author: Zack Weinberg <zackw@panix.com>
Date: Fri Aug 16 19:28:17 2019 -0400
Use clock_gettime to implement gettimeofday.
Abstractly, this is the same change as using clock_gettime to
implement time, but the vestigial âget time zoneâ feature of
gettimeofday complicates matters a little. Unlike settimeofday, there
are *no* known uses of this feature that are not bugs, so it is simply
dummied out. (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.)
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.
Hurd having already been converted, this patch only affects Linux and
hypothetical future ports. Most Linux ports supplied a vDSO symbol
for gettimeofday, and some wrapped that with an ifunc, so this patch
deletes a lot of code. For ease of future edits to the many copies of
_libc_vdso_platform_setup, the variable âpâ in each is now declared
separately from any use of it.
As with settimeofday, the alpha-linux-gnu configuration has two
versions, GLIBC_2.0 and GLIBC_2.1, with the older symbol using 32-bit
time_t (yes, really) and the same solution is implemented here.
__gettimeofday is no longer called by anyone, so remove its internal
prototype and its entries in Versions and .abilits files. (It would
have been a GLIBC_PRIVATE symbol if the GLIBC_PRIVATE convention had
been invented back in the days of 2.0.)
* time/gettimeofday.c: No longer a stub implementation.
Call __clock_gettime. If âtzâ argument is not NULL, clear the
object it points to. Remove libc_hidden_def for __gettimeofday
and libc_hidden_weak for gettimeofday. Optionally override the
default symbol version for gettimeofday.
* include/sys/time.h: Remove internal prototype and libc_hidden_proto
for __gettimeofday, and libc_hidden_proto for gettimeofday.
* time/Versions
* sysdeps/unix/sysv/linux/alpha/Versions
* sysdeps/**/libc.abilist: Remove entry for __gettimeofday.
* sysdeps/unix/sysv/linux/aarch64/init-first.c
* sysdeps/unix/sysv/linux/arm/init-first.c
* sysdeps/unix/sysv/linux/mips/init-first.c
* sysdeps/unix/sysv/linux/powerpc/init-first.c
* sysdeps/unix/sysv/linux/riscv/init-first.c
* sysdeps/unix/sysv/linux/s390/init-first.c
* sysdeps/unix/sysv/linux/sparc/init-first.c:
Do not define nor initialize VDSO_SYMBOL(gettimeofday).
* sysdeps/unix/sysv/linux/aarch64/libc-vdso.h
* sysdeps/unix/sysv/linux/arm/libc-vdso.h
* sysdeps/unix/sysv/linux/mips/libc-vdso.h
* sysdeps/unix/sysv/linux/powerpc/libc-vdso.h
* sysdeps/unix/sysv/linux/riscv/libc-vdso.h
* sysdeps/unix/sysv/linux/s390/libc-vdso.h
* sysdeps/unix/sysv/linux/sparc/libc-vdso.h:
Do not declare VDSO_SYMBOL(gettimeofday).
* sysdeps/unix/syscalls.list: Remove entry for gettimeofday.
* sysdeps/unix/sysv/linux/alpha/syscalls.list:
Remove entries for gettimeofday and osf_gettimeofday.
* sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list:
Remove entry for gettimeofday.
* sysdeps/posix/gettimeofday.c
* sysdeps/unix/sysv/linux/aarch64/gettimeofday.c
* sysdeps/unix/sysv/linux/gettimeofday.c
* sysdeps/unix/sysv/linux/i386/gettimeofday.c
* sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
* sysdeps/unix/sysv/linux/x86/gettimeofday.c: Delete file.
* sysdeps/unix/sysv/linux/alpha/osf_gettimeofday.c:
New file, defines gettimeofday@GLIBC_2.0.
* sysdeps/unix/sysv/linux/alpha/gettimeofday.c
New file, defines gettimeofday@@GLIBC_2.1.
* sysdeps/unix/make-syscalls.sh: Change an example in a comment
from referring to gettimeofday, to referring to sigaction.
commit fcc009b4e7a14dc193cfb0864de2e548e9c87fa4
Author: Zack Weinberg <zackw@panix.com>
Date: Fri Aug 16 20:56:02 2019 -0400
Use clock_gettime to implement 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.
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.
(There is an argument for turning this function into a compat symbol,
and not installing sys/timeb.h anymore. Thoughts?)
* time/ftime.c (ftime): Replace implementation with the code
formerly in sysdeps/unix/bsd/ftime.c, then change that code to use
__clock_gettime instead of __gettimeofday. Always set the
timezone and dstflag fields of the âtimebufâ argument to zero.
* sysdeps/unix/bsd/ftime.c
* sysdeps/unix/sysv/linux/ftime.c: Delete file.
commit c93d0737e6e800f70d0e3d8714ae3e20ec28a776
Author: Zack Weinberg <zackw@panix.com>
Date: Fri Aug 16 14:22:42 2019 -0400
Use clock_gettime to implement time.
Most ports were using gettimeofday to implement time, or they were
making a direct (v)syscall. Unconditionally switch to using
clock_gettime instead. All sysdeps implementations of time are
removed.
* time/time.c (time): No longer a stub implementation.
Call __clock_gettime.
* sysdeps/unix/sysv/linux/powerpc/Versions (GLIBC_PRIVATE):
Remove __vdso_time.
* sysdeps/unix/sysv/linux/powerpc/init-first.c (__vdso_time): Delete.
(_libc_vdso_platform_setup): Donât initialize __vdso_time.
* sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list: Remove entry
for time.
* sysdeps/posix/time.c
* sysdeps/unix/sysv/linux/time.c
* sysdeps/unix/sysv/linux/i386/time.c
* sysdeps/unix/sysv/linux/powerpc/time.c
* sysdeps/unix/sysv/linux/sparc/sparc64/time.c
* sysdeps/unix/sysv/linux/x86/time.c:
Delete file.
commit 79d24b6ef17002982a36c18a455a66e2840cb23a
Author: Zack Weinberg <zackw@panix.com>
Date: Fri Aug 16 16:21:13 2019 -0400
Use clock_settime to implement settimeofday.
Unconditionally, on all ports, use clock_settime to implement
settimeofday. This is a little different from using clock_settime to
implement stime, because the vestigial âset time zoneâ feature of
settimeofday complicates matters.
The only remaining uses of this feature that arenât just bugs are
using it to inform the Linux kernel of the offset between the hardware
clock and UTC, on systems where the hardware clock doesnât run in
UTC (usually because of dual-booting with Windows). They call
settimeofday with _only_ the timezone argument non-NULL. Therefore,
glibcâs new behavior is: callers of settimeofday must supply one and
only one of the two arguments. If both arguments are non-NULL, or
both arguments are NULL, the call fails and sets errno to EINVAL.
When only the timeval argument is supplied, settimeofday calls
__clock_settime(CLOCK_REALTIME), same as stime.
When only the timezone argument is supplied, settimeofday calls a new
internal function called __settimezone. On Linux, only, this function
will pass the timezone structure to the settimeofday system call. On
all other operating systems, and on Linux architectures that donât
define __NR_settimeofday, __settimezone is a stub that always sets
errno to ENOSYS and returns -1.
Another complication is that the alpha-linux-gnu configuration has two
versions of settimeofday, GLIBC_2.0 and GLIBC_2.1, with the older
symbol using 32-bit time_t (yes, really). The older symbol is
reimplemented from scratch (with the same semantics); the newer symbol
uses the generic implementation with some #ifdeffage to get the
versioning right. Henceforth, __NR_osf_settimeofday will never be
used, and __NR_settimeofday only for the timezone feature.
There are no longer any internal callers of __settimeofday, so the
internal prototype is removed.
* time/settimeofday.c (settimeofday): No longer a stub
implementation. Call __clock_settime or __settimezone depending
on arguments. Optionally override the default symbol version for
settimeofday.
* include/sys/time.h: Remove prototype for __settimeofday.
Add prototype for __settimezone.
* sysdeps/unix/syscalls.list: Remove entry for settimeofday.
* time/settimezone.c: New file.
(__settimezone): New stub implementation.
* sysdeps/unix/sysv/linux/settimezone.c: New file.
(__settimezone): Implement using settimeofday system call,
if available.
* time/Makefile (routines): Add settimezone.
* sysdeps/unix/sysv/linux/alpha/syscalls.list:
Remove entries for settimeofday and osf_settimeofday.
* sysdeps/unix/sysv/linux/alpha/osf_settimeofday.c
New file, defines settimeofday@GLIBC_2.0.
* sysdeps/unix/sysv/linux/alpha/settimeofday.c:
New file, defines settimeofday@@GLIBC_2.1.
commit 6df4704cd5b2240811635292b94fd3ad557139c2
Author: Zack Weinberg <zackw@panix.com>
Date: Fri Aug 16 15:03:16 2019 -0400
Use clock_settime to implement stime.
Unconditionally, on all ports, use clock_settime to implement stime,
not settimeofday or a direct syscall.
Note that the former stub implementation of stime would return -1 with
errno set to EINVAL if passed a null pointer. With this change, it
instead unconditionally dereferences the pointer, so any hypothetical
callers that passed NULL will now segfault. I donât think this will break
any non-contrived programs.
* time/stime.c (stime): No longer a stub implementation.
Call __clock_settime.
* sysdeps/unix/stime.c: Delete file.
* sysdeps/unix/sysv/linux/syscalls.list: Remove entry for stime.
* include/time.h: Add libc_hidden_proto for __clock_settime.
* rt/clock_settime.c, sysdeps/unix/sysv/linux/clock_settime.c:
Add libc_hidden_def for __clock_settime.
commit e0c5b8187dc0cc334e6667c4a8ab0d4104eb72a8
Author: Zack Weinberg <zackw@panix.com>
Date: Fri Aug 16 21:10:11 2019 -0400
Donât use the argument to time.
Unlike gettimeofday, I donât think it makes sense to remove all the
internal uses of time. Its callers donât care about sub-second
resolution and would be unnecessarily complicated if they had to
declare a struct timespec instead of just a time_t. However, a
handful of places were using the vestigial âresultâ argument instead
of the return value, which is ever so slightly less efficient and also
looks weird. Correct this.
* misc/syslog.c (__vsyslog_internal)
* string/strfry.c (strfry)
* time/getdate.c (__getdate_r)
* time/tst_wcsftime.c (main):
Use return value of time, not its argument.
* sysdeps/mach/sleep.c (__sleep): Remove unnecessary casts of NULL.
commit 2945aad778bcba45ac16cf94d56c7e86a2ac38a3
Author: Zack Weinberg <zackw@panix.com>
Date: Fri Aug 16 20:38:22 2019 -0400
Change most internal uses of __gettimeofday to __clock_gettime.
Since gettimeofday will shortly be implemented in terms of
clock_gettime on all platforms, internal code should use clock_gettime
directly; in addition to removing a layer of indirection, this will
allow us to remove the PLT-bypass gunk for gettimeofday. In many
cases, the changed code does fewer conversions.
A few Hurd-specific files were changed to use __host_get_time instead
of __clock_gettime, as this seemed tidier.
With the exception of support/support_test_main.c, test cases are not
modified, mainly because I didnât want to have to figure out which
test cases were testing gettimeofday specifically.
The definition of GETTIME in sysdeps/generic/memusage.h had a typo and
was not reading tv_sec at all. I fixed this. It appears nobody has been
generating malloc traces on a machine that doesnât have a superseding
definition.
* inet/deadline.c (__deadline_current_time)
* login/logout.c (logout)
* login/logwtmp.c (logwtmp)
* nis/nis_call.c (__nisfind_server)
* nptl/pthread_join_common.c (timedwait_tid)
* nptl/pthread_mutex_timedlock.c (__pthread_mutex_clocklock_common)
* nscd/nscd_helper.c (wait_on_socket, open_socket)
* resolv/gai_misc.c (handle_requests)
* resolv/gai_suspend.c (gai_suspend)
* resolv/res_send.c (evNowTime)
* sunrpc/auth_des.c (authdes_marshal, authdes_destroy)
* sunrpc/auth_unix.c (authunix_create, authunix_refresh)
* sunrpc/create_xid.c (_create_xid)
* sunrpc/svcauth_des.c (_svcauth_des)
* sysdeps/generic/memusage.h (GETTIME)
* sysdeps/mach/nanosleep.c (__libc_nanosleep)
* sysdeps/posix/tempname.c (RANDOM_BITS)
* sysdeps/pthread/aio_misc.c (handle_fildes_io)
* sysdeps/pthread/aio_suspend.c (aio_suspend):
Use __clock_gettime(CLOCK_REALTIME) instead of __gettimeofday.
Include time.h if necessary.
* sysdeps/mach/hurd/getitimer.c (__getitimer)
* sysdeps/mach/hurd/setitimer.c (setitimer_locked)
* sysdeps/mach/hurd/times.c (__times):
Use __host_get_time instead of __gettimeofday.
Include mach.h if necessary.
* sysdeps/mach/usleep.c (usleep): Remove unnecessary calls to
__gettimeofday.
* support/support_test_main.c (print_timestamp): Take a struct
timespec argument, not a struct timeval.
(signal_handler): Update to match.
Use clock_gettime(CLOCK_REALTIME) instead of gettimeofday.
* sysdeps/generic/memusage.h (GETTIME): Correct typo causing
the seconds field of each timestamp to be ignored.
commit 0a84fe552f00a3c7e86a3f105156c230b04be7ab
Author: Zack Weinberg <zackw@panix.com>
Date: Fri Aug 16 15:11:47 2019 -0400
Remove implementations of clock_[gs]ettime using [gs]ettimeofday.
gettimeofday and settimeofday are obsolete in POSIX and will not be
provided by Linux for future new architectures. The preferred
interfaces are clock_gettime and clock_settime.
In preparation for implementing all the other time query/set
interfaces using clock_gettime and clock_settime, remove the
generic-Unix implementations of clock_gettime and clock_settime that
forwarded to gettimeofday and settimeofday. Ports of glibc to
historic Unixes that provided these functions, but not clock_gettime
and clock_settime, are unlikely to be contributed anymore.
The removed implementations *were* being used on the Hurd.
Deal with this by converting the Hurd gettimeofday and settimeofday
implementations into clock_gettime and clock_settime implementations,
respectively. (They still only supply microsecond resolution.
I donât know enough about Hurd/Mach to know whether nanosecond-
resolution clocks are even available.) This means Hurd temporarily
has no implementation of gettimeofday or settimeofday; this will be
corrected in subsequent patches. (glibc will not fail to build in the
i386-gnu configuration, but gettimeofday and settimeofday will be
ENOSYS stubs.)
* sysdeps/unix/clock_gettime.c, sysdeps/unix/clock_settime.c:
Delete file.
* sysdeps/mach/gettimeofday.c: Rename to .../clock_gettime.c
and convert into an implementation of clock_gettime.
* sysdeps/mach/hurd/settimeofday.c: Rename to .../clock_settime.c
and convert into an implementation of clock_settime.
Summary of changes (added commits):
-----------------------------------
61120e4... Linux/Alpha: donât use timeval32 system calls.
8ee292e... Warn when gettimeofday is called with non-null tzp argument
fc1706b... Finish move of clock_* functions to libc.
b80148f... Revise the documentation of âsimple calendar timeâ.
6ec0607... Use clock_gettime to implement gettimeofday.
8e9ce23... Use clock_gettime to implement ftime.
069a421... Use clock_gettime to implement time.
f66ff8e... Use clock_settime to implement settimeofday.
4e83f31... Use clock_settime to implement stime.
c101e8b... Donât use the argument to time.
f9ed719... Change most internal uses of __gettimeofday to __clock_gett
68d2df0... Remove implementations of clock_[gs]ettime using [gs]ettime
d34d4c8... nscd: Improve nscd.conf comments.
4b7c741... nss: Make nsswitch.conf more distribution friendly.
a289ea0... Do not print backtraces on fatal glibc errors
1d714fd... nptl: Move pthread_attr_getdetachstate implementation into
4745f4c... Correct TEST_COMPAT conditions in totalorder compat tests.
commit 61120e45ef0b8a7c108ccec12e0221f4472479af
Author: Zack Weinberg <zackw@panix.com>
Date: Mon Aug 19 14:18:08 2019 -0400
Linux/Alpha: donât use timeval32 system calls.
Linux/Alpha has two versions of several system call wrappers that take
or return data of type âstruct timevalâ (possibly nested inside a
larger structure). The GLIBC_2.0 version is a compat symbol that
calls __NR_osf_foo or __NR_old_foo and uses a struct timeval with a
32-bit tv_sec field. The GLIBC_2.1 version is used for current code,
calls __NR_foo, and uses a struct timeval with a 64-bit tv_sec field.
This patch changes all of the remaining compat symbols of this type to
be wrappers around their GLIBC_2.1 counterparts. (gettimeofday
already received this treatment in an earlier patch in this series.)
The compat symbols that copy out a 32-bit struct timeval all check for
overflow. After the Y2038 deadline, they will fail with errno set to
EOVERFLOW, but only after copying out as much as they can, and filling
in the overflowed âstruct timevalâ(s) with tv_sec set to INT32_MAX and
tv_nsec set to zero.
The new header file tv32-compat.h is currently Alpha-specific but I
donât know any reason why it couldnât be reused to aid in writing
wrappers for all affected architectures.
* sysdeps/unix/sysv/linux/alpha/tv32-compat.h: New file declaring
types and helper functions for 32/64-bit time_t conversion.
* sysdeps/unix/sysv/linux/alpha/syscalls.list: Remove entries for
osf_getitimer, osf_setitimer, osf_utimes, osf_getrusage, and osf_wait4.
* sysdeps/unix/sysv/linux/alpha/osf_getitimer.c
* sysdeps/unix/sysv/linux/alpha/osf_getrusage.c
* sysdeps/unix/sysv/linux/alpha/osf_setitimer.c
* sysdeps/unix/sysv/linux/alpha/osf_utimes.c
* sysdeps/unix/sysv/linux/alpha/osf_wait4.c:
New files defining compatibility symbols formerly defined by
alpha/syscalls.list.
* sysdeps/unix/sysv/linux/alpha/adjtime.c: Split the compat code to...
* sysdeps/unix/sysv/linux/alpha/osf_adjtime.c: ...this new file.
* sysdeps/unix/sysv/linux/alpha/Makefile (sysdep_routines):
Add osf_adjtime.
* sysdeps/unix/sysv/linux/alpha/osf_gettimeofday.c
* sysdeps/unix/sysv/linux/alpha/osf_settimeofday.c:
Use tv32-compat.h helpers.
commit 8ee292e35b00e293b9c2ee5b2d61880ccd2955a3
Author: Zack Weinberg <zackw@panix.com>
Date: Mon Aug 19 13:51:25 2019 -0400
Warn when gettimeofday is called with non-null tzp argument.
At this stage I donât think we can issue warnings for settimeofday
with a non-null tzp argument, nor for arbitrary use of struct
timezone. But we can warn about gettimeofday with non-null tzp.
This uses a macro instead of an inline (fortify-style) function
because I got false positives with an inline, even with GCC 9.
* time/sys/time.h (__timezone_ptr_t): Delete.
(gettimeofday): Always declare second argument with type âvoid *â.
When possible, wrap with a macro that detects non-null and
non-constant second argument and issues a warning.
Improve commentary.
(settimeofday): Improve commentary.
* time/gettimeofday.c (gettimeofday):
Declare second argument as type âvoid *â.
commit fc1706b35e1794f931db6d3b14ffbbcf7575dea5
Author: Zack Weinberg <zackw@panix.com>
Date: Mon Aug 19 12:25:14 2019 -0400
Finish move of clock_* functions to libc.
In glibc 2.17, the functions clock_getcpuclockid, clock_getres,
clock_gettime, clock_nanosleep, and clock_settime were moved from
librt.so to libc.so, leaving compatibility stubs behind. Now that the
dynamic linker no longer insists on finding versioned symbols in the
same library that originally defined them, we do not need the stubs
anymore, and this means we donât need GLIBC_PRIVATE __-prefix aliases for
most of the functions anymore either. (clock_gettime is still called
all over the place internally and therefore still needs one.)
While Iâm at it, move the clock_*.c files and their tests from rt/ to
time/.
* rt/clock-compat.c: Delete file.
* rt/clock_getcpuclockid.c: Move to time/clock_getcpuclockid.c.
* rt/clock_getres.c: Move to time/clock_getres.c.
* rt/clock_gettime.c: Move to time/clock_gettime.c.
* rt/clock_nanosleep.c: Move to time/clock_nanosleep.c.
* rt/clock_settime.c: Move to time/clock_settime.c.
* rt/tst-clock.c: Move to time/tst-clock.c.
* rt/tst-clock2.c: Move to time/tst-clock2.c.
* rt/tst-clock_nanosleep.c: Move to time/tst-clock_nanosleep.c.
* rt/tst-cpuclock1.c: Move to time/tst-cpuclock1.c.
* include/time.h: Remove internal prototypes for __clock_getres,
__clock_nanosleep, and __clock_getcpuclockid.
* rt/Makefile (routines, clock-routines): Delete.
(librt-routines): Remove clock-compat.
(tests): Remove tst-clock, tst-clock2, tst-clock_nanosleep, and
tst-cpuclock1.
* time/Makefile (routines): Add clock_getcpuclockid, clock_getres,
clock_gettime, clock_settime, and clock_nanosleep.
(tests): Add tst-clock, tst-clock2, tst-clock_nanosleep, and
tst-cpuclock1.
* rt/Versions (libc GLIBC_PRIVATE): Remove __clock_getres,
__clock_settime, __clock_getcpuclockid, and __clock_nanosleep.
(librt GLIBC_2.2): Remove clock_getres, clock_gettime,
clock_settime, clock_getcpuclockid, and clock_nanosleep.
* sysdeps/**/librt.abilist: Update to match.
commit b80148f1287ad7d930332c247affac7f809e973e
Author: Zack Weinberg <zackw@panix.com>
Date: Mon Aug 19 10:31:07 2019 -0400
Revise the documentation of âsimple calendar timeâ.
This is a thorough revision of all the material relating to the
functions time, stime, gettimeofday, settimeofday, clock_gettime,
clock_getres, clock_settime, and difftime, spilling over into the
discussion of time-related data types (which now get their own
section) and touching the adjtime family as well (which deserves its
own thorough revision, but Iâd have to do a bunch of research first).
Substantive changes are:
* Document clock_gettime, clock_getres, and clock_settime. (Only
CLOCK_REALTIME and CLOCK_MONOTONIC are documented; the others are
either a bit too Linux-specific, or have more to do with measuring
CPU/processor time. That section _also_ deserves its own thorough
revision but again Iâd have to do a bunch of research first.)
* Present gettimeofday, settimeofday, and struct timeval as obsolete
relative to clock_*.
* Remove the documentation of struct timezone. Matching POSIX,
say that the type of the second argument to gettimeofday and
settimeofday is [const] void *.
* Clarify ISO C and POSIXâs requirements on time_t. Clarify the
circumstances under which difftime is equivalent to simple
subtraction.
* Consolidate documentation of most of the time-related data types
into a new section âTime Types,â right after âTime Basics.â (The
exceptions are struct tm, which stays in âBroken-down Time,â and
struct times, which stays in âProcessor And CPU Time.â
* The âElapsed Timeâ section is now called âCalculating Elapsed Timeâ
and includes only difftime and the discussion of how to compute
timeval differences by hand.
* Fold the âSimple Calendar Time,â âHigh Resolution Calendar,â and
âHigh Accuracy Clockâ sections together into two new sections titled
âGetting the Timeâ and âSetting and Adjusting the Time.â
ChangeLog:
* manual/time.texi: Major revision of text related to simple
calendar time. clock_gettime, clock_getres, and clock_settime
are now documented.
* manual/filesys.texi, manual/llio.texi, manual/threads.texi:
Update cross-references to renamed sections in time.texi.
Large blocks of text are moved around, so the diff is not terribly
informative; reviewers may find it easier to apply the diff and then
read the changed sections of the rendered manual.
The NEWS update in this patch corresponds to the previous substantive
changes.
commit 6ec060709aecd5d8459f1f6be6801cf421d8f354
Author: Zack Weinberg <zackw@panix.com>
Date: Fri Aug 16 19:28:17 2019 -0400
Use clock_gettime to implement gettimeofday.
Abstractly, this is the same change as using clock_gettime to
implement time, but the vestigial âget time zoneâ feature of
gettimeofday complicates matters a little. Unlike settimeofday, there
are *no* known uses of this feature that are not bugs, so it is simply
dummied out. (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.)
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.
Hurd having already been converted, this patch only affects Linux and
hypothetical future ports. Most Linux ports supplied a vDSO symbol
for gettimeofday, and some wrapped that with an ifunc, so this patch
deletes a lot of code. For ease of future edits to the many copies of
_libc_vdso_platform_setup, the variable âpâ in each is now declared
separately from any use of it.
As with settimeofday, the alpha-linux-gnu configuration has two
versions, GLIBC_2.0 and GLIBC_2.1, with the older symbol using 32-bit
time_t (yes, really) and the same solution is implemented here.
__gettimeofday is no longer called by anyone, so remove its internal
prototype and its entries in Versions and .abilits files. (It would
have been a GLIBC_PRIVATE symbol if the GLIBC_PRIVATE convention had
been invented back in the days of 2.0.)
* time/gettimeofday.c: No longer a stub implementation.
Call __clock_gettime. If âtzâ argument is not NULL, clear the
object it points to. Remove libc_hidden_def for __gettimeofday
and libc_hidden_weak for gettimeofday. Optionally override the
default symbol version for gettimeofday.
* include/sys/time.h: Remove internal prototype and libc_hidden_proto
for __gettimeofday, and libc_hidden_proto for gettimeofday.
* time/Versions
* sysdeps/unix/sysv/linux/alpha/Versions
* sysdeps/**/libc.abilist: Remove entry for __gettimeofday.
* sysdeps/unix/sysv/linux/aarch64/init-first.c
* sysdeps/unix/sysv/linux/arm/init-first.c
* sysdeps/unix/sysv/linux/mips/init-first.c
* sysdeps/unix/sysv/linux/powerpc/init-first.c
* sysdeps/unix/sysv/linux/riscv/init-first.c
* sysdeps/unix/sysv/linux/s390/init-first.c
* sysdeps/unix/sysv/linux/sparc/init-first.c:
Do not define nor initialize VDSO_SYMBOL(gettimeofday).
* sysdeps/unix/sysv/linux/aarch64/libc-vdso.h
* sysdeps/unix/sysv/linux/arm/libc-vdso.h
* sysdeps/unix/sysv/linux/mips/libc-vdso.h
* sysdeps/unix/sysv/linux/powerpc/libc-vdso.h
* sysdeps/unix/sysv/linux/riscv/libc-vdso.h
* sysdeps/unix/sysv/linux/s390/libc-vdso.h
* sysdeps/unix/sysv/linux/sparc/libc-vdso.h:
Do not declare VDSO_SYMBOL(gettimeofday).
* sysdeps/unix/syscalls.list: Remove entry for gettimeofday.
* sysdeps/unix/sysv/linux/alpha/syscalls.list:
Remove entries for gettimeofday and osf_gettimeofday.
* sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list:
Remove entry for gettimeofday.
* sysdeps/posix/gettimeofday.c
* sysdeps/unix/sysv/linux/aarch64/gettimeofday.c
* sysdeps/unix/sysv/linux/gettimeofday.c
* sysdeps/unix/sysv/linux/i386/gettimeofday.c
* sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
* sysdeps/unix/sysv/linux/x86/gettimeofday.c: Delete file.
* sysdeps/unix/sysv/linux/alpha/osf_gettimeofday.c:
New file, defines gettimeofday@GLIBC_2.0.
* sysdeps/unix/sysv/linux/alpha/gettimeofday.c
New file, defines gettimeofday@@GLIBC_2.1.
* sysdeps/unix/make-syscalls.sh: Change an example in a comment
from referring to gettimeofday, to referring to sigaction.
commit 8e9ce235eef63c354b278d13d118c6eb3dfc23b3
Author: Zack Weinberg <zackw@panix.com>
Date: Fri Aug 16 20:56:02 2019 -0400
Use clock_gettime to implement 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.
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.
(There is an argument for turning this function into a compat symbol,
and not installing sys/timeb.h anymore. Thoughts?)
* time/ftime.c (ftime): Replace implementation with the code
formerly in sysdeps/unix/bsd/ftime.c, then change that code to use
__clock_gettime instead of __gettimeofday. Always set the
timezone and dstflag fields of the âtimebufâ argument to zero.
* sysdeps/unix/bsd/ftime.c
* sysdeps/unix/sysv/linux/ftime.c: Delete file.
commit 069a4219518dd2f35c611e8ff186f92e118dcbf2
Author: Zack Weinberg <zackw@panix.com>
Date: Fri Aug 16 14:22:42 2019 -0400
Use clock_gettime to implement time.
Most ports were using gettimeofday to implement time, or they were
making a direct (v)syscall. Unconditionally switch to using
clock_gettime instead. All sysdeps implementations of time are
removed.
* time/time.c (time): No longer a stub implementation.
Call __clock_gettime.
* sysdeps/unix/sysv/linux/powerpc/Versions (GLIBC_PRIVATE):
Remove __vdso_time.
* sysdeps/unix/sysv/linux/powerpc/init-first.c (__vdso_time): Delete.
(_libc_vdso_platform_setup): Donât initialize __vdso_time.
* sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list: Remove entry
for time.
* sysdeps/posix/time.c
* sysdeps/unix/sysv/linux/time.c
* sysdeps/unix/sysv/linux/i386/time.c
* sysdeps/unix/sysv/linux/powerpc/time.c
* sysdeps/unix/sysv/linux/sparc/sparc64/time.c
* sysdeps/unix/sysv/linux/x86/time.c:
Delete file.
commit f66ff8e42db3f23324c9d214c06cde468b3382b2
Author: Zack Weinberg <zackw@panix.com>
Date: Fri Aug 16 16:21:13 2019 -0400
Use clock_settime to implement settimeofday.
Unconditionally, on all ports, use clock_settime to implement
settimeofday. This is a little different from using clock_settime to
implement stime, because the vestigial âset time zoneâ feature of
settimeofday complicates matters.
The only remaining uses of this feature that arenât just bugs are
using it to inform the Linux kernel of the offset between the hardware
clock and UTC, on systems where the hardware clock doesnât run in
UTC (usually because of dual-booting with Windows). They call
settimeofday with _only_ the timezone argument non-NULL. Therefore,
glibcâs new behavior is: callers of settimeofday must supply one and
only one of the two arguments. If both arguments are non-NULL, or
both arguments are NULL, the call fails and sets errno to EINVAL.
When only the timeval argument is supplied, settimeofday calls
__clock_settime(CLOCK_REALTIME), same as stime.
When only the timezone argument is supplied, settimeofday calls a new
internal function called __settimezone. On Linux, only, this function
will pass the timezone structure to the settimeofday system call. On
all other operating systems, and on Linux architectures that donât
define __NR_settimeofday, __settimezone is a stub that always sets
errno to ENOSYS and returns -1.
Another complication is that the alpha-linux-gnu configuration has two
versions of settimeofday, GLIBC_2.0 and GLIBC_2.1, with the older
symbol using 32-bit time_t (yes, really). The older symbol is
reimplemented from scratch (with the same semantics); the newer symbol
uses the generic implementation with some #ifdeffage to get the
versioning right. Henceforth, __NR_osf_settimeofday will never be
used, and __NR_settimeofday only for the timezone feature.
There are no longer any internal callers of __settimeofday, so the
internal prototype is removed.
* time/settimeofday.c (settimeofday): No longer a stub
implementation. Call __clock_settime or __settimezone depending
on arguments. Optionally override the default symbol version for
settimeofday.
* include/sys/time.h: Remove prototype for __settimeofday.
Add prototype for __settimezone.
* sysdeps/unix/syscalls.list: Remove entry for settimeofday.
* time/settimezone.c: New file.
(__settimezone): New stub implementation.
* sysdeps/unix/sysv/linux/settimezone.c: New file.
(__settimezone): Implement using settimeofday system call,
if available.
* time/Makefile (routines): Add settimezone.
* sysdeps/unix/sysv/linux/alpha/syscalls.list:
Remove entries for settimeofday and osf_settimeofday.
* sysdeps/unix/sysv/linux/alpha/osf_settimeofday.c
New file, defines settimeofday@GLIBC_2.0.
* sysdeps/unix/sysv/linux/alpha/settimeofday.c:
New file, defines settimeofday@@GLIBC_2.1.
commit 4e83f317688294ccbf554920febe9c25fd489b33
Author: Zack Weinberg <zackw@panix.com>
Date: Fri Aug 16 15:03:16 2019 -0400
Use clock_settime to implement stime.
Unconditionally, on all ports, use clock_settime to implement stime,
not settimeofday or a direct syscall.
Note that the former stub implementation of stime would return -1 with
errno set to EINVAL if passed a null pointer. With this change, it
instead unconditionally dereferences the pointer, so any hypothetical
callers that passed NULL will now segfault. I donât think this will break
any non-contrived programs.
* time/stime.c (stime): No longer a stub implementation.
Call __clock_settime.
* sysdeps/unix/stime.c: Delete file.
* sysdeps/unix/sysv/linux/syscalls.list: Remove entry for stime.
* include/time.h: Add libc_hidden_proto for __clock_settime.
* rt/clock_settime.c, sysdeps/unix/sysv/linux/clock_settime.c:
Add libc_hidden_def for __clock_settime.
commit c101e8b1860b24eba152d92b5551b3d231113508
Author: Zack Weinberg <zackw@panix.com>
Date: Fri Aug 16 21:10:11 2019 -0400
Donât use the argument to time.
Unlike gettimeofday, I donât think it makes sense to remove all the
internal uses of time. Its callers donât care about sub-second
resolution and would be unnecessarily complicated if they had to
declare a struct timespec instead of just a time_t. However, a
handful of places were using the vestigial âresultâ argument instead
of the return value, which is ever so slightly less efficient and also
looks weird. Correct this.
* misc/syslog.c (__vsyslog_internal)
* string/strfry.c (strfry)
* time/getdate.c (__getdate_r)
* time/tst_wcsftime.c (main):
Use return value of time, not its argument.
* sysdeps/mach/sleep.c (__sleep): Remove unnecessary casts of NULL.
commit f9ed7198ad415ce14fd3b217a13b8d45236e5297
Author: Zack Weinberg <zackw@panix.com>
Date: Fri Aug 16 20:38:22 2019 -0400
Change most internal uses of __gettimeofday to __clock_gettime.
Since gettimeofday will shortly be implemented in terms of
clock_gettime on all platforms, internal code should use clock_gettime
directly; in addition to removing a layer of indirection, this will
allow us to remove the PLT-bypass gunk for gettimeofday. In many
cases, the changed code does fewer conversions.
A few Hurd-specific files were changed to use __host_get_time instead
of __clock_gettime, as this seemed tidier.
With the exception of support/support_test_main.c, test cases are not
modified, mainly because I didnât want to have to figure out which
test cases were testing gettimeofday specifically.
The definition of GETTIME in sysdeps/generic/memusage.h had a typo and
was not reading tv_sec at all. I fixed this. It appears nobody has been
generating malloc traces on a machine that doesnât have a superseding
definition.
* inet/deadline.c (__deadline_current_time)
* login/logout.c (logout)
* login/logwtmp.c (logwtmp)
* nis/nis_call.c (__nisfind_server)
* nptl/pthread_join_common.c (timedwait_tid)
* nptl/pthread_mutex_timedlock.c (__pthread_mutex_clocklock_common)
* nscd/nscd_helper.c (wait_on_socket, open_socket)
* resolv/gai_misc.c (handle_requests)
* resolv/gai_suspend.c (gai_suspend)
* resolv/res_send.c (evNowTime)
* sunrpc/auth_des.c (authdes_marshal, authdes_destroy)
* sunrpc/auth_unix.c (authunix_create, authunix_refresh)
* sunrpc/create_xid.c (_create_xid)
* sunrpc/svcauth_des.c (_svcauth_des)
* sysdeps/generic/memusage.h (GETTIME)
* sysdeps/mach/nanosleep.c (__libc_nanosleep)
* sysdeps/posix/tempname.c (RANDOM_BITS)
* sysdeps/pthread/aio_misc.c (handle_fildes_io)
* sysdeps/pthread/aio_suspend.c (aio_suspend):
Use __clock_gettime(CLOCK_REALTIME) instead of __gettimeofday.
Include time.h if necessary.
* sysdeps/mach/hurd/getitimer.c (__getitimer)
* sysdeps/mach/hurd/setitimer.c (setitimer_locked)
* sysdeps/mach/hurd/times.c (__times):
Use __host_get_time instead of __gettimeofday.
Include mach.h if necessary.
* sysdeps/mach/usleep.c (usleep): Remove unnecessary calls to
__gettimeofday.
* support/support_test_main.c (print_timestamp): Take a struct
timespec argument, not a struct timeval.
(signal_handler): Update to match.
Use clock_gettime(CLOCK_REALTIME) instead of gettimeofday.
* sysdeps/generic/memusage.h (GETTIME): Correct typo causing
the seconds field of each timestamp to be ignored.
commit 68d2df078ee09a79512a697c8164e93f2edb7934
Author: Zack Weinberg <zackw@panix.com>
Date: Fri Aug 16 15:11:47 2019 -0400
Remove implementations of clock_[gs]ettime using [gs]ettimeofday.
gettimeofday and settimeofday are obsolete in POSIX and will not be
provided by Linux for future new architectures. The preferred
interfaces are clock_gettime and clock_settime.
In preparation for implementing all the other time query/set
interfaces using clock_gettime and clock_settime, remove the
generic-Unix implementations of clock_gettime and clock_settime that
forwarded to gettimeofday and settimeofday. Ports of glibc to
historic Unixes that provided these functions, but not clock_gettime
and clock_settime, are unlikely to be contributed anymore.
The removed implementations *were* being used on the Hurd.
Deal with this by converting the Hurd gettimeofday and settimeofday
implementations into clock_gettime and clock_settime implementations,
respectively. (They still only supply microsecond resolution.
I donât know enough about Hurd/Mach to know whether nanosecond-
resolution clocks are even available.) This means Hurd temporarily
has no implementation of gettimeofday or settimeofday; this will be
corrected in subsequent patches. (glibc will not fail to build in the
i386-gnu configuration, but gettimeofday and settimeofday will be
ENOSYS stubs.)
* sysdeps/unix/clock_gettime.c, sysdeps/unix/clock_settime.c:
Delete file.
* sysdeps/mach/gettimeofday.c: Rename to .../clock_gettime.c
and convert into an implementation of clock_gettime.
* sysdeps/mach/hurd/settimeofday.c: Rename to .../clock_settime.c
and convert into an implementation of clock_settime.
commit d34d4c80226b3f5a1b51a8e5b005a52fba07d7ba
Author: Carlos O'Donell <carlos@redhat.com>
Date: Wed Mar 20 22:11:32 2019 -0400
nscd: Improve nscd.conf comments.
This change adds a warning to nscd.conf about running multiple caching
services together and that it may lead to unexpected behaviours. Also we
add a note that enabling the 'shared' option will cause cache hit rates
to be misreported (a side effect of the implementation).
v2
- Rewrite comment to avoid implementation details.
commit 4b7c74179c8928d971d370e1137d202f891a4cf5
Author: Carlos O'Donell <carlos@redhat.com>
Date: Wed Mar 20 12:40:18 2019 -0400
nss: Make nsswitch.conf more distribution friendly.
The current default nsswitch.conf file provided by glibc is not very
distribution friendly. The file contains some minimal directives that no
real distribution uses. This update aims to provide a rich set of
comments which are useful for all distributions, and a broader set of
service defines which should work for all distributions.
Tested defaults on x86_64 and they work. The nsswitch.conf file more
closely matches what we have in Fedora now, and I'll adjust Fedora to
use this version with minor changes to enable Fedora-specific service
providers.
v2
- Add missing databases to manual.
- Add link to manual from default nsswitch.conf.
- Sort nsswitch.conf according to most used database first.
v3
- Only mention implemented services in 'NSS Basics.'
- Mention 'automount' in 'Services in the NSS configuration.'
- Sort services in alphabetical order.
v4
- Project name is 'Samba'.
v5
- Fix typo in manual/nss.texi.
v6
- Fix another typo in manual/nss.texi. Ran spell checker this time.
commit a289ea09ea843ced6e5277c2f2e63c357bc7f9a3
Author: Florian Weimer <fweimer@redhat.com>
Date: Mon Aug 19 15:41:29 2019 +0200
Do not print backtraces on fatal glibc errors
If the process is in a bad state, we used to print backtraces in
many cases. This is problematic because doing so could involve
a lot of work, like loading libgcc_s using the dynamic linker,
and this could itself be targeted by exploit writers. For example,
if the crashing process was forked from a long-lived process, the
addresses in the error message could be used to bypass ASLR.
Commit ed421fca42fd9b4cab7c66e77894b8dd7ca57ed0 ("Avoid backtrace from
__stack_chk_fail [BZ #12189]"), backtraces where no longer printed
because backtrace_and_maps was always called with do_abort == 1.
Rather than fixing this logic error, this change removes the backtrace
functionality from the sources. With the prevalence of external crash
handlers, it does not appear to be particularly useful. The crash
handler may also destroy useful information for debugging.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
commit 1d714fd95da16f0d97c8c670a2c899f99c01eb45
Author: Florian Weimer <fweimer@redhat.com>
Date: Fri Aug 16 22:44:44 2019 +0200
nptl: Move pthread_attr_getdetachstate implementation into libc
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
commit 4745f4c1ca4f5c774e91436e952bde27b4d91e28
Author: Joseph Myers <joseph@codesourcery.com>
Date: Fri Aug 16 19:23:30 2019 +0000
Correct TEST_COMPAT conditions in totalorder compat tests.
I noticed that the totalorder compat tests mixed TEST_COMPAT
conditions using COMPAT_VER (computed as the first symbol version for
the symbol being tested) and those with a hardcoded GLIBC_2_25.
COMPAT_VER is logically correct here, so this patch changes the tests
to use it. GLIBC_2_25 is harmless at present (even for _FloatN /
_FloatNx functions added in later glibc versions). However, if in
future we support _Float16 functions in glibc for any existing
configuration, the test using GLIBC_2_25 would get things wrong
(wrongly think that there are compat versions of totalorderf16 and
totalordermagf16 to test).
(The actual definitions of the compat / versioned symbols for the
totalorder functions make no attempt to deal with the possibility of
libm function support for a new floating-point format, already
supported for other architectures in glibc, being added in some glibc
configuration in future, for which the only vaguely plausible case
would be if some architecture gets _Float128 support it previously
lacked; this is much like functions added after glibc 2.4 not
generally attempting to deal with compat support for long double
changing away from having the same format as double.)
Tested for x86_64, and with build-many-glibcs.py.
* math/libm-test-compat_totalorder.inc (do_test)
[TEST_COMPAT (libm, GLIBC_2_25, GLIBC_2_31)]: Change condition to
[TEST_COMPAT (libm, COMPAT_VER, GLIBC_2_31)].
* math/libm-test-compat_totalordermag.inc (do_test)
[TEST_COMPAT (libm, GLIBC_2_25, GLIBC_2_31)]: Likewise.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-08-20 12:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-20 12:07 [glibc/zack/y2038-preliminaries] (17 commits) Linux/Alpha: don’t use timeval32 system calls Zack Weinberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).