From 20de4d9f7789ea0850ad4273a6f9c53673ed5a40 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Mon, 1 Oct 2012 10:20:08 +0200 Subject: [PATCH] getitimer.2: Note Linux's odd handling of the new_value==NULL case Reported-by: Trevor Woerner Signed-off-by: Michael Kerrisk --- man2/getitimer.2 | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/man2/getitimer.2 b/man2/getitimer.2 index c2447a19a..9c9ae3075 100644 --- a/man2/getitimer.2 +++ b/man2/getitimer.2 @@ -4,7 +4,7 @@ .\" Modified Tue Oct 22 00:22:35 EDT 1996 by Eric S. Raymond .\" 2005-04-06 mtk, Matthias Lang .\" Noted MAX_SEC_IN_JIFFIES ceiling -.TH GETITIMER 2 2012-09-30 "Linux" "Linux Programmer's Manual" +.TH GETITIMER 2 2012-10-01 "Linux" "Linux Programmer's Manual" .SH NAME getitimer, setitimer \- get or set value of an interval timer .SH SYNOPSIS @@ -166,6 +166,21 @@ and the three interfaces and .BR usleep (3) unspecified. + +The standards are silent on the meaning of the call: + + setitimer(which, NULL, &old_value); + +Many systems (Solaris, the BSDs, and perhaps others) +treat this as equivalent to: + + getitimer(which, &old_value); + +In Linux, this is treated as being equivalent to a call in which the +.I new_value +fields are zero; that is, the timer is disabled. +.IR "Don't use this Linux misfeature" : +it is nonportable and unnecessary. .SH BUGS The generation and delivery of a signal are distinct, and only one instance of each of the signals listed above may be pending