A Alejandro Colomar (man-pages) #
Message details and related content
Hi Thomas & Ingo,
I tested the changes. Everything's OK.
Cheers,
Alex
$ uname -a
Linux debian 5.10.0-rc7+alx3+ #4 SMP Thu Dec 10 18:05:03 CET 2020 x86_64
GNU/Linux
.../linux/tools/testing/selftests/futex$ sudo ./run.sh
[sudo] password for user:
TAP version 13
1..1
# futex_requeue_pi: Test requeue functionality
# Arguments: broadcast=0 locked=0 owner=0 timeout=0ns
ok 1 futex-requeue-pi
# Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0
TAP version 13
1..1
# futex_requeue_pi: Test requeue functionality
# Arguments: broadcast=1 locked=0 owner=0 timeout=0ns
ok 1 futex-requeue-pi
# Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0
TAP version 13
1..1
# futex_requeue_pi: Test requeue functionality
# Arguments: broadcast=1 locked=1 owner=0 timeout=0ns
ok 1 futex-requeue-pi
# Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0
TAP version 13
1..1
# futex_requeue_pi: Test requeue functionality
# Arguments: broadcast=1 locked=0 owner=1 timeout=0ns
ok 1 futex-requeue-pi
# Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0
TAP version 13futex(2) says that 'utime' is a pointer to 'const'.
The implementation doesn't use 'const';
however, it _never_ modifies the contents of utime.
- futex() either uses 'utime' as a pointer to struct or as a 'u32'.
- In case it's used as a 'u32', it makes a copy of it,
and of course it is not dereferenced.
- In case it's used as a 'struct __kernel_timespec __user *',
the pointer is not dereferenced inside the futex() definition,
and it is only passed to a function: get_timespec64(),
which accepts a 'const struct __kernel_timespec __user *'.
context:
........
[[
FUTEX(2) Linux Programmer's Manual FUTEX(2)
NAME
futex - fast user-space locking
SYNOPSIS
#include <linux/futex.h>
#include <stdint.h>
#include <sys/time.h>
long futex(uint32_t *uaddr, int futex_op, uint32_t val,
const struct timespec *timeout, /* or: uint32_t val2 */
uint32_t *uaddr2, uint32_t val3);
Note: There is no glibc wrapper for this system call; see
NOTES.
]]
$ sed -n '/SYSCALL_DEFINE.(futex\>/,/^}/p' linux/kernel/futex.c
SYSCALL_DEFINE6(futex, u32 __user *, uaddr, int, op, u32, val,
struct __kernel_timespec __user *, utime, u32 __user *, uaddr2,
u32, val3)-- Alejandro Colomar Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/ http://www.alejandro-colomar.es