From: George Fankhauser <gfa@sensaco.com>
To: linux-kernel@vger.kernel.org
Subject: setcontext syscall
Date: Thu, 20 Nov 2003 08:03:04 +0100 [thread overview]
Message-ID: <3FBC6728.7030504@sensaco.com> (raw)
Hi there!
I wonder why linux i386 does not implement setcontext as a syscall.
Instead it's in in glibc in userspace.
The problem that one may run into is with asynchronous signals such as
SIGALRM, VTALRM, and IO: Let's say you have good reason to block such
signals because your handling one of them and want to restore another
user context which has them enabled in its sigmask. What sigcontext
simply does is
1. trap into sigprocmask
2. restore all regs and jump
after exit of 1) until jump in 2) there is plenty of time to run into
another asynchronous signal which must be detected in the nested handler
etc. This is rather ugly.
I see this as a main reason to put setcontext into the kernel. Another
one is performance: since we use sigprocmask, a syscall is used anyway.
And BTW: All SysV implementations use indeed syscalls for set/getcontext
for these reasons.
What do you think?
regards
George
--
Sensaco GmbH
mailto:gfa@sensaco.com
next reply other threads:[~2003-11-20 7:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-20 7:03 George Fankhauser [this message]
2003-11-20 8:02 ` setcontext syscall Benjamin Herrenschmidt
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=3FBC6728.7030504@sensaco.com \
--to=gfa@sensaco.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.