From owner-freebsd-hackers Thu Jan 9 6:31:17 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CAC5037B401 for ; Thu, 9 Jan 2003 06:31:15 -0800 (PST) Received: from prioris.mini.pw.edu.pl (prioris.mini.pw.edu.pl [194.29.178.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 48F7943ED8 for ; Thu, 9 Jan 2003 06:31:15 -0800 (PST) (envelope-from P.Dawidek@prioris.mini.pw.edu.pl) Received: from localhost (localhost.mini.pw.edu.pl [127.0.0.1]) by prioris.mini.pw.edu.pl (Postfix) with ESMTP id 5AA337D2F8 for ; Thu, 9 Jan 2003 15:31:04 +0100 (CET) Received: by prioris.mini.pw.edu.pl (Postfix, from userid 1091) id AE5A87D2F6; Thu, 9 Jan 2003 15:30:59 +0100 (CET) Date: Thu, 9 Jan 2003 15:30:59 +0100 From: Pawel Jakub Dawidek To: freebsd-hackers@freebsd.org Subject: Exceptions via setjmp/longjmp in kernel. Message-ID: <20030109143059.GC47263@prioris.mini.pw.edu.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline User-Agent: Mutt/1.4i X-PGP-Key-URL: http://garage.freebsd.pl/jules.pgp X-OS: FreeBSD 4.7-STABLE i386 X-Virus-Scanned: by AMaViS (prioris) Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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().")); [...] longjmp(buf, value_diffrent_than_1); [...] And setjmp() returns only 0 or 1 (when longjmp() is called), but never returns value that I've put in longjmp() call. There could be some other problems in using setjmp()/longjmp() in kernel? I'm paying attention on memory leaks and locks that are done before longjmp(). -- Pawel Jakub Dawidek UNIX Systems Administrator http://garage.freebsd.pl Am I Evil? Yes, I Am. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message