Subject: | Time::HiRes::alarm() ignores EINVAL from setitimer() |
Date: | Mon, 22 Jul 2013 18:39:36 +0200 |
To: | bug-Time-HiRes [...] rt.cpan.org |
From: | Anand Galama <galama [...] mailfish.de> |
According to the docs, alarm() is supposed to return undef if an error
occurred. This is not the case when setitimer() sets EINVAL:
$ strace -e trace=setitimer,write perl -MTime::HiRes=alarm -E '$|=1; say
$Time::HiRes::VERSION; say alarm(1); say alarm(3000);' >/dev/null
write(1, "1.9725\n", 7) = 7
setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={1, 0}},
{it_interval={0, 0}, it_value={0, 0}}) = 0
write(1, "0\n", 2) = 2
setitimer(ITIMER_REAL, {it_interval={0, 0},
it_value={18446744073709550322, 18446744073708584320}}, 0x7fff4a0a6d90)
= -1 EINVAL (Invalid argument)
write(1, "0\n", 2) = 2
+++ exited with 0 +++
$