From: angelo.borsotti@gmail.com
To: linux-kernel@vger.kernel.org
Subject: Re: Re: Strange Linux behaviour with blocking syscalls and stop signals+SIGCONT
Date: Sat, 7 Nov 2009 14:43:03 -0500 [thread overview]
Message-ID: <13000625.11257622983772.JavaMail.root@wombat> (raw)
In-Reply-To: <Pine.LNX.4.64.0607061217320.3869@g5.osdl.org>
I would venture to suggest a possible solution. But let's fist see what
could be a reasoneable goal to achieve. Compatibility with existing
applications is a must, so, solutions must not break it.
Easy porting applications written for other Unixes is also a desirable
feature. Being able to write correct programs that cope with stopping/
continuing is also a must.
The very last (correctness) cannot be achieved with the existing API:
suppose you are implementing a library, and you want to cope with
stopping (i.e. make the process using the library continue properly
after having been stopped). You cannot simply restart calls (the 16
ones that are interrupted by stop signals) because EINTR can be
returned also when other signals have been catched. You cannot either
rely on some flags set in a handler for SIGCONT because handlers
might be already in place when your library functions are called
(and you cannot change them since they are out of your control).
A possible solution to consider is to have the kernel store the number
of the signal that interrupted a call so that user code can decide
the action that is most appropriate for the signal received.
Since this adds to the existing API, it cannot break existing programs.
People that want to port code from other Unixes can do that simply
writing wrappers for the 16 syscalls that restart them when a stop
signal is received. People that want to cope with stop signals in new
code can restart them testing the signal that interrupted the calls
(it would use a feature that is not in the POSIX standard, but it
would work).
--
This message was sent on behalf of angelo.borsotti@gmail.com at openSubscriber.com
http://www.opensubscriber.com/message/linux-kernel@vger.kernel.org/4393984.html
next prev parent reply other threads:[~2009-11-07 20:09 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 [this message]
2006-07-07 4:32 ` Michael Kerrisk
2006-07-07 4:57 ` Ulrich Drepper
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=13000625.11257622983772.JavaMail.root@wombat \
--to=angelo.borsotti@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/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