Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Apr 2000 00:17:56 -0400 (EDT)
From:      Daniel Eischen <eischen@vigrid.com>
To:        current@FreeBSD.ORG, sprice@hiwaay.net
Subject:   Re: signal mask from jmp_buf
Message-ID:  <200004050417.AAA04115@pcnet1.pcnet.com>

next in thread | raw e-mail | index | archive | help
> Hi all,
> 
> What is the proper way for obtaining the signal mask from
> within the jmp_buf struct on 4.x or -current?  Previously
> with the JDK port for < 3.x we did something like this:
> 
>         signalMask = jmpbuf[0]._sjb[6];
> 
> This no longer works now that we support >32 signals.  Is
> there a better, more portable way that will work for all
> versions of FreeBSD?
> 
> Thanks.

Hmm, OK, I'll bite.                          

One of the things I've been looking at is getting rid of the
sigprocmask() calls within setjmp/longjmp for libc_r (basically
just switching to use _setjmp/_longjmp instead, since the
threads library already knows what the signal mask of each
thread is).  

If we supported {get,set}context, I'd say use those instead
of setjmp/longjmp since the signal mask is in ucp->uc_sigmask.
I do have working {get,set,make,swap}context implemented as
library routines for i386 (and also _getcontext,_setcontext
which don't get/set the signal masks), and am working on the
alpha bits (could use some help here).

I am unfamiliar with the JDK port.  Does it use FreeBSD native
threads?  The threads library knows what each threads signal
mask is, and we should be able to eliminate the system calls
to get/set the signal masks if we switch to the non-signal
mask saving/restoring versions of these functions.  Can you
not use pthread_sigmask() to get/set the signal mask for each
thread?       

-- 
Dan Eischen


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200004050417.AAA04115>