No subject

users-errors at users-errors at
Mon Jan 15 15:11:53 PST 2007

504 at> <45A08F10.4030004 at> <45A81D54.5040909 at> <002701c736a8$72084a20$1200a8c0 at> <45A82676.1000204 at> <007301c736ac$5c99da10$1200a8c0 at> <45A838AA.9030008 at> <200701130306.l0D36JX8007342 at> <45A87472.3040108 at> <45A879FF.8060407 at> <200701130649.l0D6nE8j008759 at apollo.> <009301c73746$cdce3470$1200a8c0 at> <200701132000.l0DK0QsA020885 at ap> <00b101c738ù¿¿©â>O¯LðS(OFrom: Matthew Dillon <dillon at>
Subject: Re: Request for swapcontext and getcontext to be ported to our libc [ revision 3 ]
Date: Mon, 15 Jan 2007 15:01:11 -0800 (PST)
List-Post: <mailto:users at>
List-Subscribe: <mailto:users-request at>
List-Unsubscribe: <mailto:users-request at>
List-Help: <mailto:users-request at>
List-Owner: <mailto:owner-users at>
Sender: users-errors at
Errors-To: users-errors at
Lines: 42
X-Trace: 1168902882 829
Xref: dragonfly.users:8621

:A first cut of the libc-based implementation, using a (new) syscall to
:get/set the signal its is available, and can be found here:
: (rev3, bottom of page)
:Note that this implementation is not complete, as it is missing the userland
:get/set_mcontext code.  I'm sure I've also missed some nuance wrt signal
:handling (locking, ordering, etc) in the design and use of the new sigmask
:Matt Emmerton

    Ok, I see a few things, all easy to fix:

    * sigpend is not swapped in and out.  This is the bitmask of pending
      signals.  It stays as it is.

    * sigmask must be adjusted by the kernel to remove unmaskable signals
      using SIG_CANTMASK(sigmask);

    * There is a naming conflict between the sigmask() system call and 
      thethe 'sigmask' identifier, but (see next item)...

    * You shouldn't need a new system call anyway, the sigprocmask() system
      call can be used to retrieve and set the signal mask.  I recommend
      using that.

    There is one more issue, and that is an atomicy issue.  We want the
    new signal mask to be set simultaniously with the restoration of the
    context (or most of it).  This means that all signals must be masked
    temporarily while restoring the context.  But don't worry about it,
    I can handle that part as well.  It does mean an extra system call
    but that isn't our concern at the moment.

    I can fill in the missing code assembly, no problem.  If you do one
    more rev using sigprocmask() instead of creating a new system call
    I can then take it from there.

					Matthew Dillon 
					<dillon at>

More information about the Users mailing list