lkml.org 
[lkml]   [2003]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectsetcontext syscall
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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:58    [W:0.542 / U:0.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site