This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug nptl/14484] sem_timedwait always return -1 with errno 110 (ETIMEDOUT).
- From: "tingw.liu at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Wed, 22 Aug 2012 00:33:53 +0000
- Subject: [Bug nptl/14484] sem_timedwait always return -1 with errno 110 (ETIMEDOUT).
- Auto-submitted: auto-generated
- References: <bug-14484-131@http.sourceware.org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=14484
--- Comment #8 from tingweiliu <tingw.liu at gmail dot com> 2012-08-22 00:33:01 UTC ---
(In reply to comment #7)
> Your signal handler is not installed to be interrupting, so if sem_timedwait
> returns with EINTR (which it _DOES_ do on some/most Linux versions), that's a
> bug in the kernel. The expected result is ETIMEDOUT.
> Perhaps you expect signal() to have the legacy sysv behavior of installing
> interrupting signal handlers. This is not the case on glibc. If you want
> interrupting behavior, you must use sigaction() and omit the SA_RESTART flag.
> I still don't see any bug.
I have set the timeout = gettimeofday + 4000us , So if it return ETIMEDOUT, the
real timeout should about 4000us.
But the output is:
#./sem_timedwait
sem_timedwait ret=-1 failed.errno=110 Real timeout=4us
sem_timedwait ret=-1 failed.errno=110 Real timeout=4us
I think the Real timeout should about 4000us, but it's 4us. Why?
Thanks for your reply!
--- Comment #9 from tingweiliu <tingw.liu at gmail dot com> 2012-08-22 00:33:53 UTC ---
(In reply to comment #7)
> Your signal handler is not installed to be interrupting, so if sem_timedwait
> returns with EINTR (which it _DOES_ do on some/most Linux versions), that's a
> bug in the kernel. The expected result is ETIMEDOUT.
> Perhaps you expect signal() to have the legacy sysv behavior of installing
> interrupting signal handlers. This is not the case on glibc. If you want
> interrupting behavior, you must use sigaction() and omit the SA_RESTART flag.
> I still don't see any bug.
I have set the abstimeout = gettimeofday + 4000us , So if it return ETIMEDOUT,
the real timeout should about 4000us.
But the output is:
#./sem_timedwait
sem_timedwait ret=-1 failed.errno=110 Real timeout=4us
sem_timedwait ret=-1 failed.errno=110 Real timeout=4us
I think the Real timeout should about 4000us, but it's 4us. Why?
Thanks for your reply!
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.