From 331dcbfb3a48bdb99b63915122ae17fd37d5f802 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Tue, 28 Aug 2007 13:15:35 +0000 Subject: [PATCH] Since kernel 2.6.22, Linux setitimer() now conforms to POSIX.1, giving an EINVAL error for a non-canonical tv_usec value. --- man2/getitimer.2 | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/man2/getitimer.2 b/man2/getitimer.2 index 5a2d822a5..e4d3d6b84 100644 --- a/man2/getitimer.2 +++ b/man2/getitimer.2 @@ -130,7 +130,10 @@ is not one of .BR ITIMER_REAL , .BR ITIMER_VIRTUAL , or -.BR ITIMER_PROF . +.BR ITIMER_PROF ; +or (since kernel 2.6.22) one of the +.I tv_usec +fields contains a value outside the range 0 to 999999. .SH "CONFORMING TO" POSIX.1-2001, SVr4, 4.4BSD (this call first appeared in 4.2BSD). .SH NOTES @@ -173,24 +176,19 @@ POSIX.1-2001 says that should fail if a .I tv_usec value is specified that is outside of the range 0 to 999999. -However, Linux does not give an error, but instead silently +However, in kernels up to and including 2.6.21, +Linux does not give an error, but instead silently adjusts the corresponding seconds value for the timer. -In the future (scheduled for March 2007), -this non-conformance will be repaired: -existing applications should be fixed now to ensure that they supply -a properly formed +From kernel 2.6.22 onwards, +this non-conformance has been repaired: +an improper .I tv_usec -value. -.\" FIXME . Bugzilla report 25 Apr 2006: +value results in an +.B EINVAL +error. +.\" Bugzilla report 25 Apr 2006: .\" http://bugzilla.kernel.org/show_bug.cgi?id=6443 .\" "setitimer() should reject non-canonical arguments" -.\" The feedback on this report points to a kernel patch -.\" which apparently should result in this problem -.\" being fixed after a clean-up period of one year -.\" (i.e., March 2007). -.\" Not fixed as at 2.6.21, May 2007. -.\" The fix is in as at 2.6.22-rc2 -- check whether it makes it to release -.\" See the EINVAL error return from kernel/itimer.c::do_setitimer(). .SH "SEE ALSO" .BR gettimeofday (2), .BR sigaction (2),