This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug nptl/14484] sem_timedwait always return -1 with errno 110 (ETIMEDOUT).


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!

-- 
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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]