mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-13 06:40:09 +00:00
c3f9aef063
Unconditionally, on all ports, use clock_settime to implement settimeofday. Remove sysdeps/unix/clock_settime.c, which implemented clock_settime by calling settimeofday; new OS ports must henceforth provide a real implementation of clock_settime. Hurd had a real implementation of settimeofday but not of clock_settime; this patch converts it into an implementation of clock_settime. It only supports CLOCK_REALTIME and microsecond resolution; Hurd/Mach does not appear to have any support for finer-resolution clocks. The vestigial "set time zone" feature of settimeofday complicates the generic settimeofday implementation a little. 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). There currently isn't any other way to do this. However, the callers that do this 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. The settimeoday syscall is enabled on Linux by the flag COMPAT_32BIT_TIME, which is an option to either 32-bits ABIs or COMPAT builds (defined usually by 64-bit kernels that want to support 32-bit ABIs, such as x86). The idea to future 64-bit time_t only ABIs is to not provide settimeofday syscall. The same semantics are implemented for Linux/Alpha's GLIBC_2.0 compat symbol for settimeofday. There are no longer any internal callers of __settimeofday, so the internal prototype is removed. Checked on x86_64-linux-gnu, i686-linux-gnu, powerpc64le-linux-gnu, powerpc64-linux-gnu, powerpc-linux-gnu, and aarch64-linux-gnu. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Reviewed-by: Lukasz Majewski <lukma@denx.de>
36 lines
1.5 KiB
Plaintext
36 lines
1.5 KiB
Plaintext
# File name Caller Syscall name Args Strong name Weak names
|
|
|
|
sigstack - sigstack 2 sigstack
|
|
|
|
getpriority - getpriority i:ii __getpriority getpriority
|
|
|
|
# proper socket implementations:
|
|
bind - bind i:ipi __bind bind
|
|
getpeername - getpeername i:ipp __getpeername getpeername
|
|
getsockname - getsockname i:ipp __getsockname getsockname
|
|
getsockopt - getsockopt i:iiiBN __getsockopt getsockopt
|
|
listen - listen i:ii __listen listen
|
|
setsockopt - setsockopt i:iiibn __setsockopt setsockopt
|
|
shutdown - shutdown i:ii __shutdown shutdown
|
|
socket - socket i:iii __socket socket
|
|
socketpair - socketpair i:iiif __socketpair socketpair
|
|
|
|
ptrace - ptrace 4 __ptrace ptrace
|
|
|
|
# access pci space protected from machine checks:
|
|
pciconfig_read EXTRA pciconfig_read 5 pciconfig_read
|
|
pciconfig_write EXTRA pciconfig_write 5 pciconfig_write
|
|
pciconfig_iobase EXTRA pciconfig_iobase 3 __pciconfig_iobase pciconfig_iobase
|
|
|
|
# timeval64 entry points (see osf_*.c for GLIBC_2.0 timeval32 equivalents)
|
|
gettimeofday - gettimeofday i:pP __GI___gettimeofday gettimeofday@@GLIBC_2.1 __gettimeofday@@GLIBC_2.1
|
|
getitimer - getitimer i:ip __getitimer getitimer@@GLIBC_2.1
|
|
setitimer - setitimer i:ipP __setitimer setitimer@@GLIBC_2.1
|
|
utimes - utimes i:sp __utimes utimes@@GLIBC_2.1
|
|
getrusage - getrusage i:ip __getrusage getrusage@@GLIBC_2.1
|
|
wait4 - wait4 i:iWiP __wait4 wait4@@GLIBC_2.1
|
|
|
|
# avoid 64-bit aliases on 32-bit statfs syscalls
|
|
fstatfs - fstatfs i:ip __fstatfs fstatfs
|
|
statfs - statfs i:sp __statfs statfs
|