public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ulrich Drepper <drepper@redhat.com>
To: Michael Kerrisk <michael.kerrisk@gmx.net>
Cc: manfred@colorfullife.com, linux-kernel@vger.kernel.org,
	tytso@mit.edu, torvalds@osdl.org, eggert@cs.ucla.edu,
	roland@redhat.com, rlove@rlove.org, mtk-lkml@gmx.net,
	mtk-manpages@gmx.net
Subject: Re: Strange Linux behaviour with blocking syscalls and stop signals+SIGCONT
Date: Thu, 06 Jul 2006 21:57:26 -0700	[thread overview]
Message-ID: <44ADE9B6.1020900@redhat.com> (raw)
In-Reply-To: <20060707043220.186800@gmx.net>

[-- Attachment #1: Type: text/plain, Size: 1366 bytes --]

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 ❖


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 251 bytes --]

  reply	other threads:[~2006-07-07  4:57 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-03 14:46 Strange Linux behaviour with blocking syscalls and stop signals+SIGCONT Michael Kerrisk
2006-07-04 19:02 ` Manfred Spraul
2006-07-06  9:23   ` Michael Kerrisk
2006-07-06 18:42     ` Manfred Spraul
2006-07-06 18:55       ` Ulrich Drepper
2006-07-06 19:02         ` Manfred Spraul
2006-07-06 19:10           ` Ulrich Drepper
2006-07-06 19:18           ` Linus Torvalds
2006-07-06 19:28             ` Manfred Spraul
2006-07-06 19:29               ` Manfred Spraul
2006-07-07  4:57             ` Michael Kerrisk
2006-07-07  5:10               ` Linus Torvalds
2006-07-07  5:12                 ` Linus Torvalds
2009-11-07 19:43             ` angelo.borsotti
2006-07-07  4:32         ` Michael Kerrisk
2006-07-07  4:57           ` Ulrich Drepper [this message]
2006-07-07  5:07             ` Michael Kerrisk
2006-07-07  6:20               ` Ulrich Drepper
2006-07-07  7:03                 ` Michael Kerrisk
2006-07-07  7:20                   ` Arjan van de Ven
2006-07-07  8:02                     ` Michael Kerrisk
2006-07-07  9:26                       ` Jakub Jelinek
2006-07-07 13:36                         ` Ulrich Drepper
2006-07-07  4:28       ` Michael Kerrisk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44ADE9B6.1020900@redhat.com \
    --to=drepper@redhat.com \
    --cc=eggert@cs.ucla.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.com \
    --cc=michael.kerrisk@gmx.net \
    --cc=mtk-lkml@gmx.net \
    --cc=mtk-manpages@gmx.net \
    --cc=rlove@rlove.org \
    --cc=roland@redhat.com \
    --cc=torvalds@osdl.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox