This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
absolute time change does not affect posix timer
- From: "Li, Adam" <adam dot li at intel dot com>
- To: "GNU C Library" <libc-alpha at sources dot redhat dot com>
- Date: Mon, 24 May 2004 14:11:56 +0800
- Subject: absolute time change does not affect posix timer
Hi,
A test case in Open Posix testsuite failed on latest glibc with linux
kernel 2.6.5:
conformance/interfaces/clock_settime/4-1.c
http://cvs.sourceforge.net/viewcvs.py/*checkout*/posixtest/posixtestsuit
e/conformance/interfaces/clock_settime/4-1.c?rev=1.8
This test creates a timer using CLOCK_REALTIME, and sets the timer with
TIMER_ABSTIME flag.
Then it changes CLOCK_REALTIME using clock_settime().
But the test result shows that the timer expired according to the old
clock.
Here is part of the strace output:
15:36:47 clock_gettime(0, {1085413007, 980012000}) = 0
...........
15:36:47 timer_create(0, {0x40015f50, 14, SIGEV_SIGNAL, {...}},
{0x11000000}) = 0
15:36:47 timer_settime(0x11000000, TIMER_ABSTIME, {it_interval={0, 0},
it_value={1085413016, 980012000}}, NULL) = 0
.... .......
15:36:47 nanosleep({3, 0}, {3, 0}) = 0
15:36:50 clock_gettime(0, {1085413010, 981806000}) = 0
15:36:50 clock_settime(0, {1085413007, 980012000}) = 0 //Set the clock
to new value
15:36:47 rt_sigtimedwait([ALRM], 0, 0, 8) = 14
// Timer expired. We expect it to expire at 1085413016 of new clock.
15:36:53 clock_gettime(0, {1085413013, 979849000}) = 0
15:36:53 clock_settime(0, {1085413016, 981806000}) = 0 //restore the
clock
If this is totally a kernel issue and glibc can do nothing, sorry for
the post and I will turn to
linux kernel mailing list for fix.
Regards,
-adam
------------------------------------------------
Message above is personal view, not my employer's.