Since kernel 2.6.22, Linux setitimer() now conforms to POSIX.1,

giving an EINVAL error for a non-canonical tv_usec value.
This commit is contained in:
Michael Kerrisk 2007-08-28 13:15:35 +00:00
parent 67b0af33ba
commit 331dcbfb3a
1 changed files with 13 additions and 15 deletions

View File

@ -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),