0.8.19.29:
authorChristophe Rhodes <csr21@cam.ac.uk>
Thu, 17 Feb 2005 11:26:07 +0000 (11:26 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Thu, 17 Feb 2005 11:26:07 +0000 (11:26 +0000)
Add (untested, so sue me) getenv and putenv to sb-posix

contrib/sb-posix/TODO
contrib/sb-posix/interface.lisp
version.lisp-expr

index 27de86b..f28b5d5 100644 (file)
@@ -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).
index ed265c1..aca0e7d 100644 (file)
        (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))
index 7684ff3..d09672d 100644 (file)
@@ -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"