diff --git a/docs/cmu-user/cmu-user.tex b/docs/cmu-user/cmu-user.tex index 1ced324bae9cbb49039e99eb89ab2913cea3cb1f..69120a6fbbbfeaca86911be9c2c40ac4d862a680 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