mirror of git://sourceware.org/git/glibc.git
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.
|
||
|---|---|---|
| ChangeLog.old | ||
| argp | ||
| assert | ||
| benchtests | ||
| bits | ||
| catgets | ||
| conform | ||
| crypt | ||
| csu | ||
| ctype | ||
| debug | ||
| dirent | ||
| dlfcn | ||
| elf | ||
| gmon | ||
| gnulib | ||
| grp | ||
| gshadow | ||
| hesiod | ||
| htl | ||
| hurd | ||
| iconv | ||
| iconvdata | ||
| include | ||
| inet | ||
| intl | ||
| io | ||
| libio | ||
| locale | ||
| localedata | ||
| login | ||
| mach | ||
| malloc | ||
| manual | ||
| math | ||
| mathvec | ||
| misc | ||
| nis | ||
| nptl | ||
| nptl_db | ||
| nscd | ||
| nss | ||
| po | ||
| posix | ||
| pwd | ||
| resolv | ||
| resource | ||
| rt | ||
| scripts | ||
| setjmp | ||
| shadow | ||
| signal | ||
| socket | ||
| soft-fp | ||
| stdio-common | ||
| stdlib | ||
| string | ||
| sunrpc | ||
| support | ||
| sysdeps | ||
| sysvipc | ||
| termios | ||
| time | ||
| timezone | ||
| wcsmbs | ||
| wctype | ||
| .gitattributes | ||
| .gitignore | ||
| COPYING | ||
| COPYING.LIB | ||
| ChangeLog | ||
| INSTALL | ||
| LICENSES | ||
| MAINTAINERS | ||
| Makeconfig | ||
| Makefile | ||
| Makefile.in | ||
| Makerules | ||
| NEWS | ||
| 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 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 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 http://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 http://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 http://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.