]> git.ipfire.org Git - thirdparty/glibc.git/commit - include/time.h
time: Introduce function to check correctness of nanoseconds value
authorLukasz Majewski <lukma@denx.de>
Thu, 24 Oct 2019 14:20:56 +0000 (16:20 +0200)
committerLukasz Majewski <lukma@denx.de>
Sun, 27 Oct 2019 20:49:25 +0000 (21:49 +0100)
commit48123656609fea92a154f08ab619ab5186276432
tree34c399889dbe5271b30b7c840f9fd048875e704f
parent513aaa0d782f8fae36732d06ca59d658149f0139
time: Introduce function to check correctness of nanoseconds value

The valid_nanoseconds () static inline function has been introduced to
check if nanoseconds value is in the correct range - greater or equal to
zero and less than 1000000000.

The explicit #include <time.h> has been added to files where it was
missing.

The __syscall_slong_t type for ns has been used to avoid issues on x32.

Tested with:
- scripts/build-many-glibcs.py
- make PARALLELMFLAGS="-j12" && make PARALLELMFLAGS="-j12" xcheck on x86_64
24 files changed:
hurd/hurdlock.c
hurd/hurdselect.c
include/time.h
io/ppoll.c
nptl/lll_timedlock_wait.c
nptl/pthread_cond_wait.c
nptl/pthread_join_common.c
nptl/pthread_mutex_timedlock.c
nptl/pthread_rwlock_common.c
nptl/sem_clockwait.c
nptl/sem_timedwait.c
sysdeps/htl/pt-cond-timedwait.c
sysdeps/htl/pt-mutex-timedlock.c
sysdeps/htl/pt-rwlock-timedrdlock.c
sysdeps/htl/pt-rwlock-timedwrlock.c
sysdeps/htl/sem-timedwait.c
sysdeps/mach/hurd/htl/pt-hurd-cond-timedwait.c
sysdeps/mach/nanosleep.c
sysdeps/pthread/timer_settime.c
sysdeps/sparc/sparc32/lowlevellock.c
sysdeps/unix/clock_nanosleep.c
sysdeps/unix/clock_settime.c
sysdeps/unix/sysv/linux/clock_settime.c
time/clock_nanosleep.c