]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
prctl.2: Correct some details for PR_SET_TIMERSLACK
authorYang Xu <xuyang2018.jy@cn.fujitsu.com>
Wed, 24 Jul 2019 06:52:23 +0000 (14:52 +0800)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Tue, 30 Jul 2019 06:25:37 +0000 (08:25 +0200)
In kernel/sys.c, arg2 is an unsigned long value and it will never
less than 0. Also, since kernel commit id da8b44d5a9f8 (Linux
4.6), timer_slack_ns and default timer_slack_ns have been
converted into u64, the return value of PR_GET_TIMERSLACK has been
limited under ULONG_MAX.

The timer slack value also can be inherited by a child created via
fork(2).

Reviewed-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man2/prctl.2

index 52fd0f3f3ddcaeae99c42eb255d325388588a97b..348a39f6aeeca49774b4d6403d1e07580c354339 100644 (file)
@@ -1239,14 +1239,15 @@ this operation expects a user-space buffer of 8 (not 4) bytes on these ABIs.
 Each thread has two associated timer slack values:
 a "default" value, and a "current" value.
 This operation sets the "current" timer slack value for the calling thread.
+.I arg2
+is an unsigned long value, then maximum "current" value is ULONG_MAX and
+the minimum "current" value is 1.
 If the nanosecond value supplied in
 .IR arg2
 is greater than zero, then the "current" value is set to this value.
 If
 .I arg2
-is less than or equal to zero,
-.\" It seems that it's not possible to set the timer slack to zero;
-.\" The minimum value is 1? Seems a little strange.
+is equal to zero,
 the "current" timer slack is reset to the
 thread's "default" timer slack value.
 .IP
@@ -1291,7 +1292,9 @@ The timer slack values of
 .IR init
 (PID 1), the ancestor of all processes,
 are 50,000 nanoseconds (50 microseconds).
-The timer slack values are preserved across
+The timer slack value is inherited by a child created via
+.BR fork(2),
+and is preserved across
 .BR execve (2).
 .IP
 Since Linux 4.6, the "current" timer slack value of any process