From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.lisp.guile.devel Subject: doc system-error-errno Date: Wed, 28 Jul 2004 11:08:04 +1000 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <87d62h0wi3.fsf@zip.com.au> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1090977039 15027 80.91.224.253 (28 Jul 2004 01:10:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 28 Jul 2004 01:10:39 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Jul 28 03:10:28 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Bpcxg-0006B3-00 for ; Wed, 28 Jul 2004 03:10:28 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bpd0n-0007kf-4U for guile-devel@m.gmane.org; Tue, 27 Jul 2004 21:13:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Bpd0e-0007kP-Sl for guile-devel@gnu.org; Tue, 27 Jul 2004 21:13:32 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Bpd0e-0007kD-0s for guile-devel@gnu.org; Tue, 27 Jul 2004 21:13:32 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bpd0d-0007kA-Rm for guile-devel@gnu.org; Tue, 27 Jul 2004 21:13:31 -0400 Original-Received: from [61.8.0.84] (helo=mailout1.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BpcxU-0006Yj-BU for guile-devel@gnu.org; Tue, 27 Jul 2004 21:10:16 -0400 Original-Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.0.87]) by mailout1.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id i6S1AE4u029971 for ; Wed, 28 Jul 2004 11:10:14 +1000 Original-Received: from localhost (ppp20F1.dyn.pacific.net.au [61.8.32.241]) by mailproxy2.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id i6S1ADgH020491 for ; Wed, 28 Jul 2004 11:10:13 +1000 Original-Received: from gg by localhost with local (Exim 3.36 #1 (Debian)) id 1BpcvQ-0003mm-00; Wed, 28 Jul 2004 11:08:08 +1000 Original-To: guile-devel@gnu.org Mail-Copies-To: never User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:3900 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:3900 A tweak to the wording at the end of the posix "Conventions" node, using @defun for system-error-errno instead of just describing it in words. Errors which the C library would report by returning a null pointer or through some other means are reported by raising a `system-error' exception. The parameters to this exception are the function name (a string), a message format string and argument list, and the Unix `errno' variable (an integer). (define (my-handler key func fmt fmtargs errno) ...) (catch 'system-error (lambda () ...) my-handler) -- Function: system-error-errno arglist Return the `errno' value exception arguments, or `#f' if not available (if not a `system-error' exception). (catch 'system-error (lambda () (mkdir "/this-ought-to-fail-if-I'm-not-root")) (lambda stuff (let ((errno (system-error-errno stuff))) (cond ((= errno EACCES) (display "You're not allowed to do that.")) ((= errno EEXIST) (display "Already exists.")) (#t (display (strerror errno)))) (newline)))) _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel