Exceptions via setjmp/longjmp in kernel.

2003-01-09 Thread Pawel Jakub Dawidek
Hello hackers... I got strange problem when trying to implement something like exceptions with setjmp()/longjmp() functions. [...] int ret; jmpbuf buf; [...] ret = setjmp(buf); KASSERT(ret != 1, (I never return 1 with longjmp

Re: Exceptions via setjmp/longjmp in kernel.

2003-01-09 Thread Stefan Farfeleder
On Thu, Jan 09, 2003 at 03:30:59PM +0100, Pawel Jakub Dawidek wrote: I got strange problem when trying to implement something like exceptions with setjmp()/longjmp() functions. [...] int ret; jmpbuf buf; [...] ret = setjmp(buf); KASSERT(ret != 1, (I

Re: Exceptions via setjmp/longjmp in kernel.

2003-01-09 Thread Jake Burkholder
Apparently, On Thu, Jan 09, 2003 at 03:30:59PM +0100, Pawel Jakub Dawidek said words to the effect of; Hello hackers... I got strange problem when trying to implement something like exceptions with setjmp()/longjmp() functions. [...] int ret; jmpbuf buf

Re: Exceptions via setjmp/longjmp in kernel.

2003-01-09 Thread Pawel Jakub Dawidek
On Thu, Jan 09, 2003 at 11:03:55AM -0500, Jake Burkholder wrote: + The kernel longjmp only ever seems to return 1. See i386/i386/support.s. That's right, thanks! But this is strange, setjmp/longjmp are defined in C99 and there setjmp() returns value from longjmp(). -- Pawel Jakub Dawidek UNIX

Re: Exceptions via setjmp/longjmp in kernel.

2003-01-09 Thread Erik Trulsson
On Thu, Jan 09, 2003 at 05:25:20PM +0100, Pawel Jakub Dawidek wrote: On Thu, Jan 09, 2003 at 11:03:55AM -0500, Jake Burkholder wrote: + The kernel longjmp only ever seems to return 1. See i386/i386/support.s. That's right, thanks! But this is strange, setjmp/longjmp are defined in C99

Re: Exceptions via setjmp/longjmp in kernel.

2003-01-09 Thread Julian Elischer
how do you ensure that the thread doesn't own any locks when it does the longjmp? On Thu, 9 Jan 2003, Pawel Jakub Dawidek wrote: Hello hackers... I got strange problem when trying to implement something like exceptions with setjmp()/longjmp() functions. [...] int ret

Re: Exceptions via setjmp/longjmp in kernel.

2003-01-09 Thread Pawel Jakub Dawidek
On Thu, Jan 09, 2003 at 10:51:13AM -0800, Julian Elischer wrote: + how do you ensure that the thread doesn't own any locks when it does the + longjmp? Hmm, hard to explain. I got my own infrastructure for this and every locks that are done I got in my-threads, so I just have to check those thread

Re: setjmp/longjmp

2001-10-03 Thread Julian Elischer
PROTECTED] Cc: Peter Pentchev [EMAIL PROTECTED]; Gersh [EMAIL PROTECTED]; Bernd Walter [EMAIL PROTECTED]; Anjali Kulkarni [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, October 03, 2001 6:14 AM Subject: Re: setjmp/longjmp On Tuesday, 2 October 2001 at 12:43:54 -0700, Julian

Re: setjmp/longjmp

2001-10-03 Thread Greg Lehey
: On Fri, Sep 28, 2001 at 07:03:51PM +0530, Anjali Kulkarni wrote: Does anyone know whether it is advisable or not to use setjmp/longjmp within kernel code? I could not see any setjmp/longjmp in kernel source code. Is there a good reason for this or can it be used? You need to look again

Re: setjmp/longjmp

2001-10-02 Thread Peter Pentchev
28, 2001 at 07:03:51PM +0530, Anjali Kulkarni wrote: Does anyone know whether it is advisable or not to use setjmp/longjmp within kernel code? I could not see any setjmp/longjmp in kernel source code. Is there a good reason for this or can it be used? You need to look again, it's used

Re: setjmp/longjmp

2001-10-02 Thread Julian Elischer
: On Fri, 28 Sep 2001, Bernd Walter wrote: On Fri, Sep 28, 2001 at 07:03:51PM +0530, Anjali Kulkarni wrote: Does anyone know whether it is advisable or not to use setjmp/longjmp within kernel code? I could not see any setjmp/longjmp in kernel source code. Is there a good reason

Re: setjmp/longjmp

2001-10-02 Thread Greg Lehey
, Julian Elischer wrote: On Fri, 28 Sep 2001, Gersh wrote: On Fri, 28 Sep 2001, Bernd Walter wrote: On Fri, Sep 28, 2001 at 07:03:51PM +0530, Anjali Kulkarni wrote: Does anyone know whether it is advisable or not to use setjmp/longjmp within kernel code? I could not see any setjmp/longjmp

Re: setjmp/longjmp

2001-10-02 Thread Anjali Kulkarni
[EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, October 03, 2001 6:14 AM Subject: Re: setjmp/longjmp On Tuesday, 2 October 2001 at 12:43:54 -0700, Julian Elischer wrote: On Tue, 2 Oct 2001, Peter Pentchev wrote: On Mon, Oct 01, 2001 at 10:56:24AM +0930, Greg Lehey wrote

Re: setjmp/longjmp

2001-09-30 Thread Greg Lehey
know whether it is advisable or not to use setjmp/longjmp within kernel code? I could not see any setjmp/longjmp in kernel source code. Is there a good reason for this or can it be used? You need to look again, it's used in several places in the kernel. Look at sys/i386/i386/db_interface.c

setjmp/longjmp

2001-09-28 Thread Anjali Kulkarni
hi, Does anyone know whether it is advisable or not to use setjmp/longjmp within kernel code? I could not see any setjmp/longjmp in kernel source code. Is there a good reason for this or can it be used? Thanks, Anjali

Re: setjmp/longjmp

2001-09-28 Thread Bernd Walter
On Fri, Sep 28, 2001 at 07:03:51PM +0530, Anjali Kulkarni wrote: hi, Does anyone know whether it is advisable or not to use setjmp/longjmp within kernel code? I could not see any setjmp/longjmp in kernel source code. Is there a good reason for this or can it be used? You need to look again

Re: setjmp/longjmp

2001-09-28 Thread Gersh
Look at sys/i386/i386/db_interface.c On Fri, 28 Sep 2001, Bernd Walter wrote: On Fri, Sep 28, 2001 at 07:03:51PM +0530, Anjali Kulkarni wrote: hi, Does anyone know whether it is advisable or not to use setjmp/longjmp within kernel code? I could not see any setjmp/longjmp in kernel source

Re: setjmp/longjmp

2001-09-28 Thread Julian Elischer
at 07:03:51PM +0530, Anjali Kulkarni wrote: hi, Does anyone know whether it is advisable or not to use setjmp/longjmp within kernel code? I could not see any setjmp/longjmp in kernel source code. Is there a good reason for this or can it be used? You need to look again, it's used