From owner-freebsd-current Tue Apr 4 21:18:25 2000 Delivered-To: freebsd-current@freebsd.org Received: from pcnet1.pcnet.com (pcnet1.pcnet.com [204.213.232.3]) by hub.freebsd.org (Postfix) with ESMTP id 0F26537B528 for ; Tue, 4 Apr 2000 21:18:08 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: (from eischen@localhost) by pcnet1.pcnet.com (8.8.7/PCNet) id AAA04115; Wed, 5 Apr 2000 00:17:56 -0400 (EDT) Date: Wed, 5 Apr 2000 00:17:56 -0400 (EDT) From: Daniel Eischen Message-Id: <200004050417.AAA04115@pcnet1.pcnet.com> To: current@FreeBSD.ORG, sprice@hiwaay.net Subject: Re: signal mask from jmp_buf Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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