From 0cb98e3896bc363afbb977729bd144a02bace542 Mon Sep 17 00:00:00 2001
From: pw <pw>
Date: Wed, 14 Mar 2001 23:21:57 +0000
Subject: [PATCH] From Eric Marsden

The following patch adds a description of the *environment-list*
variable to the user manaul. It also provides an example for using the
Unix syscalls.
---
 docs/cmu-user/cmu-user.tex | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/docs/cmu-user/cmu-user.tex b/docs/cmu-user/cmu-user.tex
index 1ced324ba..69120a6fb 100644
--- a/docs/cmu-user/cmu-user.tex
+++ b/docs/cmu-user/cmu-user.tex
@@ -9893,6 +9893,20 @@ structures.
   A stream connected to \file{/dev/tty}.
 \end{defvar}
 
+\begin{defvar}{extensions:}{environment-list}
+  The environment variables inherited by the current process, as a
+  keyword-indexed alist. For example, to access the DISPLAY
+  environment variable, you could use
+
+\begin{lisp}
+   (cdr (assoc :display ext:*environment-list*))
+\end{lisp}
+
+  Note that the case of the variable name is lost in the conversion
+  to a keyword.
+\end{defvar}
+
+
 %%\node Lisp Equivalents for C Routines, Type Translations, Useful Variables, UNIX Interface
 \section{Lisp Equivalents for C Routines}
 
@@ -10055,6 +10069,16 @@ The Unix system calls indicate an error by returning \false{} as the
 first value and the Unix error number as the second value.  If the call
 succeeds, then the first value will always be non-\nil, often \code{t}.
 
+For example, to use the \code{chdir} syscall: 
+
+\begin{lisp}
+(multiple-value-bind (success errno)
+    (unix:unix-chdir "/tmp")
+  (unless success
+     (error "Can't change working directory: ~a"
+            (unix:get-unix-error-msg errno))))
+\end{lisp}
+
 \begin{defun}{Unix:}{get-unix-error-msg}{\args{\var{error}}}
 
   This function returns a string describing the Unix error number
-- 
GitLab