lkml.org 
[lkml]   [2006]   [Jul]   [7]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateThu, 06 Jul 2006 21:57:26 -0700
FromUlrich Drepper <>
SubjectRe: Strange Linux behaviour with blocking syscalls and stop signals+SIGCONT
Michael Kerrisk wrote:
>> Whoa, not so fast.  At least the futex syscall but be interruptible by
>> signals.  It is crucial to return EINTR.
> 
> When you say "return" do you mean "in kernel", or "return 
> to userspace"?  My (possibly naive) understanding is that
> one could simply s/EINTR/ERESTARTNOHAND/ for FUTEX_WAIT, in
> order to achieve the change I want: for userland that 
> ERESTARTNOHAND would be returned as EINTR if a signal 
> handler interrupted the FUTEX_WAIT.

The futex syscall must _at least_ behave like every other syscall which
can block and can be interrupted by a signal.  It essential for internal
operation (cancellation) but also for programs.  For the former any
change which still allows EINTR to be reported could be acceptable.  We
install the signal handler internally and so make sure it's correct.

sem_wait() is another case.  Here the EINTR handling is exposed to the
programmer.  Currently, as I understand it, even SA_RESTART handlers
cause EINTR to be returned.  Yes, this usually correct but it  might
disrupt existing code.

This is why I'd caution anybody who thinks about changing something in
this area.  *I* could live with it, I can fix and recompile all the code
I use.  But others aren't that lucky.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2006-07-07 05:05    [from the cache]
©2003-2008