guile-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

guile/guile-core/doc posix.texi


From: Marius Vollmer
Subject: guile/guile-core/doc posix.texi
Date: Sat, 16 Jun 2001 13:16:13 -0700

CVSROOT:        /cvs
Module name:    guile
Changes by:     Marius Vollmer <address@hidden> 01/06/16 13:16:13

Modified files:
        guile-core/doc : posix.texi 

Log message:
        (Conventions): Use `system-error-errno' instead of explicit code

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/doc/posix.texi.diff?cvsroot=OldCVS&tr1=1.9&tr2=1.10&r1=text&r2=text

Patches:
Index: guile/guile-core/doc/posix.texi
diff -u guile/guile-core/doc/posix.texi:1.9 guile/guile-core/doc/posix.texi:1.10
--- guile/guile-core/doc/posix.texi:1.9 Sat May 19 04:13:47 2001
+++ guile/guile-core/doc/posix.texi     Sat Jun 16 13:16:12 2001
@@ -68,15 +68,12 @@
 
 For ways to deal with exceptions, @ref{Exceptions}.
 
-Errors which the C-library would report by returning a NULL
-pointer or through some other means are reported by raising a
address@hidden exception.
-The value of the Unix @code{errno} variable is available
+Errors which the C-library would report by returning a NULL pointer or
+through some other means are reported by raising a @code{system-error}
+exception.  The value of the Unix @code{errno} variable is available
 in the data passed by the exception.
 
-Here's an address@hidden may be changed in the future; be prepared
-to rewrite this sort of code.} way to extract the @code{errno} value
-from an exception:
+It can be extracted with the function @code{system-error-errno}:
 
 @example
 (catch
@@ -84,7 +81,7 @@
  (lambda ()
    (mkdir "/this-ought-to-fail-if-I'm-not-root"))
  (lambda stuff
-   (let ((errno (car (list-ref stuff 4))))
+   (let ((errno (system-error-errno 4)))
      (cond
       ((= errno EACCES)
        (display "You're not allowed to do that."))
@@ -94,9 +91,6 @@
        (display (strerror errno))))
      (newline))))
 @end example
-
-The important thing to note is that the @code{errno} value can be
-extracted with @code{(car (list-ref stuff 4))}.
 
 @node Ports and File Descriptors
 @section Ports and File Descriptors



reply via email to

[Prev in Thread] Current Thread [Next in Thread]