From 92ac91fcecf79634b94e97a02bbd22b37c2aa559 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Thu, 17 Feb 2005 11:26:07 +0000 Subject: [PATCH] 0.8.19.29: Add (untested, so sue me) getenv and putenv to sb-posix --- contrib/sb-posix/TODO | 7 ++++++- contrib/sb-posix/interface.lisp | 12 ++++++++++++ version.lisp-expr | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/contrib/sb-posix/TODO b/contrib/sb-posix/TODO index 27de86b..f28b5d5 100644 --- a/contrib/sb-posix/TODO +++ b/contrib/sb-posix/TODO @@ -51,4 +51,9 @@ than going thru an exception mechanism that will be invoked everytime. 9) proper alien definitions of structures [ possibly an sb-grovel problem, but the way we define calls exposes the problem -- see -readdir() ] +readdir() ] [ isn't this done? ] + +10) some functions (e.g. fdatasync, putenv) have a return value which +is purely an error indicator. Currently we're returning the 0 on +success, but maybe it would make more sense for them to return +(values). diff --git a/contrib/sb-posix/interface.lisp b/contrib/sb-posix/interface.lisp index ed265c1..aca0e7d 100644 --- a/contrib/sb-posix/interface.lisp +++ b/contrib/sb-posix/interface.lisp @@ -326,3 +326,15 @@ (syscall-error)) (setf termios (alien-to-termios a-termios termios)))) termios) + +;;; environment + +(export 'sb-posix::getenv :sb-posix) +(defun sb-posix::getenv (name) + (let ((r (alien-funcall + (extern-alien "getenv" (function (* char) c-string)) + name))) + (declare (type (alien (* char)) r)) + (unless (null-alien r) + (cast r c-string)))) +(define-call "putenv" int minusp (string c-string)) diff --git a/version.lisp-expr b/version.lisp-expr index 7684ff3..d09672d 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.8.19.28" +"0.8.19.29" -- 1.7.10.4