about summary refs log tree commit diff
path: root/elf/tst-unique1mod1.c
diff options
context:
space:
mode:
authorZack Weinberg <zackw@panix.com>2019-07-27 19:26:23 -0400
committerZack Weinberg <zackw@panix.com>2019-07-27 20:14:35 -0400
commit3f649995a112b91754b49b7fff389385ce55f54f (patch)
tree3999bdce24cbfc67c223f3610ba6dd92d59d0994 /elf/tst-unique1mod1.c
parent50ce3eae5ba304650459d4441d7d246a7cefc26f (diff)
downloadglibc-zack/gtod-no-timezone.tar.gz
glibc-zack/gtod-no-timezone.tar.xz
glibc-zack/gtod-no-timezone.zip
Remove access to legacy time zone support in gettimeofday etc. zack/gtod-no-timezone
gettimeofday and ftime are not quite fully implementable on systems
that only provide a primitive equivalent to clock_gettime, because
they can also report information about a system-wide time zone.  This
mechanism has been deprecated for many years because it can only be
configured on a system-wide basis, and because it only supports the
simplest kinds of daylight-savings rules, but we’ve supported it on a
best-effort basis until now.  This patch removes our support for it:

 * The type 'struct timezone' is still declared as a complete type in
   <sys/time.h>, but code that uses its fields (tz_minuteswest and
   tz_dsttime) will not compile.

 * Similarly, code that uses the 'timezone' and 'dstflag' fields of
   struct timeb will not compile anymore.  (This is a willful
   violation of the older iterations of XPG that included
   sys/timeb.h; the relevant conformance tests are XFAILed.)

 * Old binaries that pass a non-NULL 'tzp' pointer to gettimeofday
   will always receive a 'struct timezone' whose tz_minuteswest and
   tz_dsttime fields are zero (as if the system were operating on UTC).

 * Similarly, old binaries that call ftime will always receive a
   'struct timeb' whose timezone and dstflag fields are zero.

 * If the 'tzp' argument to settimeofday is not NULL, the call will fail
   and set errno to ENOSYS.  (This was already the case on the Hurd.)

 * glibc will always pass a second argument of NULL when invoking a
   kernel-provided gettimeofday.

 * On Alpha, the compat symbols gettimeofday@GLIBC_2.0 and
   settimeofday@GLIBC_2.0 (which used 32-bit time_t) now convert
   their arguments and call system primitives that use 64-bit time_t,
   instead of invoking legacy “osf” system calls.

ChangeLog:

	* time/sys/time.h (struct timezone): Remove tz_minuteswest
	and tz_dsttime fields; replace with padding to preserve the size.
	* time/sys/timeb.h (struct timeb): Remove timezone and dstflag
	fields; replace with padding to preserve the size.
	* conform/Makefile: XFAIL tests because struct timeb is no longer
	fully conformant with Unix98.

	* sysdeps/posix/gettimeofday.c
	* sysdeps/unix/sysv/linux/gettimeofday.c
	* sysdeps/unix/sysv/linux/aarch64/gettimeofday.c
	* sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
	* sysdeps/unix/sysv/linux/x86/gettimeofday.c
	(gettimeofday): When ‘tz’ argument is not NULL, just clear it.
	Always pass a null pointer as the second argument to a
	gettimeofday (v)syscall.

	* sysdeps/unix/bsd/ftime.c: Unconditionally clear the memory that
	was formerly the ‘timezone’ and ‘dstflag’ fields of struct timeb.

	* sysdeps/unix/syscalls.list: Remove entry for settimeofday.
	* sysdeps/unix/settimeofday.c: New file.
	(settimeofday): Fail with ENOSYS if ‘tz’ argument is not NULL.

	* sysdeps/unix/sysv/linux/alpha/syscalls.list: Remove entries for
        osf_gettimeofday, osf_settimeofday, and settimeofday.
	* sysdeps/unix/sysv/linux/alpha/osf_gettimeofday.c:
	New file.  Call the 64-bit gettimeofday, then convert to a
	32-bit struct timeval.  On overflow, saturate the struct timeval
	and fail with EOVERFLOW.
	* sysdeps/unix/sysv/linux/alpha/osf_settimeofday.c: New file.
        Convert to a 64-bit struct timeval and call 64-bit settimeofday.
        Fail with ENOSYS if ‘tz’ argument is not NULL.

	* sunrpc/auth_des.c, sunrpc/auth_unix.c
	* sysdeps/posix/time.c, sysdeps/unix/stime.c:
	Remove unnecessary casts of NULL.

	* sysdeps/unix/sysv/linux/powerpc/time.c (time_syscall):
	Use (void *)0 instead of NULL when passing a null pointer
	as an untyped argument.

	* manual/time.texi: Remove documentation of fields of
	struct timezone.  Revise text to further emphasize that
	the second argument to gettimeofday/settimeofday should
	always be a null pointer.
Diffstat (limited to 'elf/tst-unique1mod1.c')
0 files changed, 0 insertions, 0 deletions