glibc/sysdeps/unix/sysv/linux/alpha
Zack Weinberg c3f9aef063 Use clock_settime to implement settimeofday.
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>
2019-10-30 17:05:14 -03:00
..
alpha
alphaev6/fpu
alphaev67/fpu
bits Define __STATFS_MATCHES_STATFS64 2019-10-24 09:14:26 -07:00
fpu
sys Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
Implies
Makefile Linux/Alpha: don't use timeval32 system calls. 2019-10-30 17:03:42 -03:00
Versions Alpha: Fix the RLIM_INFINITY and RLIM64_INFINITY constants 2018-01-05 20:34:10 +01:00
____longjmp_chk.S Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
a.out.h Break lines before not after operators, batch 4. 2019-03-07 20:20:25 +00:00
adjtime.c Linux/Alpha: don't use timeval32 system calls. 2019-10-30 17:03:42 -03:00
adjtimex.c Linux/Alpha: don't use timeval32 system calls. 2019-10-30 17:03:42 -03:00
aio_cancel.c
brk.S Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
c++-types.data
clone.S Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
configure
configure.ac
dl-auxv.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
dl-brk.S
dl-fxstatat64.c
dl-support.c
dl-sysdep.c
fraiseexcpt.S Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
fstatfs64.c
fstatvfs.c
fstatvfs64.c
fxstat.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
fxstatat.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
getclktck.c
getcontext.S Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
getdents.c Consolidate Linux getdents{64} implementation 2018-04-19 08:49:52 -03:00
getdents64.c Consolidate Linux getdents{64} implementation 2018-04-19 08:49:52 -03:00
getegid.S alpha: force old OSF1 syscalls for getegid, geteuid and getppid [BZ #24986] 2019-09-14 18:22:52 +02:00
geteuid.S alpha: force old OSF1 syscalls for getegid, geteuid and getppid [BZ #24986] 2019-09-14 18:22:52 +02:00
gethostname.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
getppid.S alpha: force old OSF1 syscalls for getegid, geteuid and getppid [BZ #24986] 2019-09-14 18:22:52 +02:00
getrlimit64.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
getsysstats.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
glob-lstat-compat.c posix: Add compat glob symbol to not follow dangling symbols 2017-09-25 18:04:16 -07:00
globfree.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
ieee_get_fp_control.S Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
ieee_set_fp_control.S Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
internal_statvfs64.c
ioperm.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
ipc_priv.h ipc: Refactor sysvipc internal definitions 2019-10-17 11:04:59 -03:00
jmp_buf-macros.h Add jmp_buf-macros.h 2017-11-09 05:10:03 -08:00
kernel-features.h ipc: Refactor sysvipc internal definitions 2019-10-17 11:04:59 -03:00
kernel_sigaction.h alpha: Use Linux generic sigaction implementation 2018-12-18 19:52:21 -02:00
kernel_stat.h
kernel_sysinfo.h
kernel_termios.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
ld.abilist Ignore absolute symbols in ABI tests. 2018-05-04 15:46:32 +00:00
libBrokenLocale.abilist Ignore absolute symbols in ABI tests. 2018-05-04 15:46:32 +00:00
libanl.abilist Ignore absolute symbols in ABI tests. 2018-05-04 15:46:32 +00:00
libc.abilist Finish move of clock_* functions to libc. [BZ #24959] 2019-09-04 14:39:38 +02:00
libcrypt.abilist Ignore absolute symbols in ABI tests. 2018-05-04 15:46:32 +00:00
libdl.abilist Ignore absolute symbols in ABI tests. 2018-05-04 15:46:32 +00:00
libm.abilist Make totalorder and totalordermag functions take pointer arguments. 2019-08-15 15:18:34 +00:00
libnsl.abilist Ignore absolute symbols in ABI tests. 2018-05-04 15:46:32 +00:00
libpthread.abilist nptl: Move pthread_attr_setschedparam implementation into libc 2019-10-07 20:00:38 +02:00
libresolv.abilist Ignore absolute symbols in ABI tests. 2018-05-04 15:46:32 +00:00
librt.abilist Finish move of clock_* functions to libc. [BZ #24959] 2019-09-04 14:39:38 +02:00
libthread_db.abilist Ignore absolute symbols in ABI tests. 2018-05-04 15:46:32 +00:00
libutil.abilist Ignore absolute symbols in ABI tests. 2018-05-04 15:46:32 +00:00
localplt.data
lxstat.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
makecontext.S Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
nldbl-abi.h
oldglob.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
osf_adjtime.c Linux/Alpha: don't use timeval32 system calls. 2019-10-30 17:03:42 -03:00
osf_getitimer.c Linux/Alpha: don't use timeval32 system calls. 2019-10-30 17:03:42 -03:00
osf_getrusage.c Linux/Alpha: don't use timeval32 system calls. 2019-10-30 17:03:42 -03:00
osf_gettimeofday.c Linux/Alpha: don't use timeval32 system calls. 2019-10-30 17:03:42 -03:00
osf_setitimer.c Linux/Alpha: don't use timeval32 system calls. 2019-10-30 17:03:42 -03:00
osf_settimeofday.c Use clock_settime to implement settimeofday. 2019-10-30 17:05:14 -03:00
osf_utimes.c Linux/Alpha: don't use timeval32 system calls. 2019-10-30 17:03:42 -03:00
osf_wait4.c Linux/Alpha: don't use timeval32 system calls. 2019-10-30 17:03:42 -03:00
pipe.S
register-dump.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
rt_sigaction.S Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
select.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
setcontext.S Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
setfpucw.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
setrlimit64.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
settimeofday.c Use clock_settime to implement settimeofday. 2019-10-30 17:05:14 -03:00
shlib-versions
sigcontextinfo.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
sigprocmask.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
sizes.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
statfs64.c
statvfs.c
statvfs64.c
swapcontext.S Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
syscall.S Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
syscalls.list Use clock_settime to implement settimeofday. 2019-10-30 17:05:14 -03:00
sysconf.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
sysdep.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
timer_create.c
timer_delete.c
timer_getoverr.c
timer_gettime.c
timer_settime.c
tv32-compat.h Use clock_settime to implement settimeofday. 2019-10-30 17:05:14 -03:00
ucontext-offsets.sym
vfork.S Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
wordexp.c
xstat.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
xstatconv.c Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
xstatconv.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00