[PATCH v2] prctl.2: correct the wrong message about PR_SET_TIMERSLACK

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In kernel/sys.c, arg2 is an unsigned long value and it will never
less than 0. Also, since kernel commit id da8b44d5a9f8, 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).

Signed-off-by: Yang Xu <xuyang2018.jy@xxxxxxxxxxxxxx>
---
 man2/prctl.2 | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/man2/prctl.2 b/man2/prctl.2
index 52fd0f3f3..348a39f6a 100644
--- a/man2/prctl.2
+++ b/man2/prctl.2
@@ -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
-- 
2.18.1






[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux