]> git.ipfire.org Git - thirdparty/glibc.git/commit
Don’t include sys/time.h from sys/timex.h.
authorZack Weinberg <zackw@panix.com>
Fri, 31 May 2019 14:30:38 +0000 (10:30 -0400)
committerZack Weinberg <zackw@panix.com>
Wed, 8 Jan 2020 18:45:45 +0000 (13:45 -0500)
commit886864a8f2436d8c13f37c425ef28293146691ce
treeada468fbc33bd7f8c16e4cf79ac25db861117516
parent225a0f4ef94a6505f2bb28d44d85bb3a9a45e5ef
Don’t include sys/time.h from sys/timex.h.

The interfaces defined in sys/timex.h only need struct timeval, not
any of the other things defined in sys/time.h.

While I was at it I moved stuff around so that sysdeps/…/linux/bits/timex.h
defines everything that uapi linux/timex.h defines (as of version 5.0;
alas, we still cannot use linux/timex.h directly) plus the
MOD_CLKA and MOD_CLKB constants.  In particular, the TIME_* constants
are relevant to users of clock_adjtime as well as adjtimex (I presume—
clock_adjtime is not very well documented) so they should be visible
from time.h as well as sys/timex.h.  Conversely, as far as I can tell,
struct ntptimeval was never a kernel interface on Linux, and MAXTC is
not part of the exposed API and also has the wrong value for current
kernels.   Also I removed a thoroughly obsolete bug workaround from
ntp_gettime.c and ntp_gettimex.c.

* sysdeps/unix/sysv/linux/sys/timex.h: Don’t include sys/time.h.
Update commentary.  Don’t define MAXTC.  Move definition of
NTP_API and the TIME_* constants...
* sysdeps/unix/sysv/linux/bits/timex.h: ...here.
Allow inclusion only by sys/timex.h and bits/time.h.
Update commentary.

        * sysdeps/unix/sysv/linux/ntp_gettime.c
        * sysdeps/unix/sysv/linux/ntp_gettimex.c: Remove obsolete
check for MOD_OFFSET not being defined.

* scripts/check-obsolete-constructs.py (HEADER_ALLOWED_INCLUDES):
Update.
scripts/check-obsolete-constructs.py
sysdeps/unix/sysv/linux/bits/timex.h
sysdeps/unix/sysv/linux/ntp_gettime.c
sysdeps/unix/sysv/linux/ntp_gettimex.c
sysdeps/unix/sysv/linux/sys/timex.h