X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=contrib%2Fsb-posix%2Finterface.lisp;h=aca0e7dad451fc23f4b28144a2f9dc9bf2a9e9cd;hb=5e2b057871cf47c795c75106899f5fb05dc3397e;hp=bf9498e80105cff796b8a89757884a498ba1e1e0;hpb=14a1a090731b8fa3632a6e4b51deee8cbc8f59c9;p=sbcl.git diff --git a/contrib/sb-posix/interface.lisp b/contrib/sb-posix/interface.lisp index bf9498e..aca0e7d 100644 --- a/contrib/sb-posix/interface.lisp +++ b/contrib/sb-posix/interface.lisp @@ -219,10 +219,8 @@ ;;; mmap, msync (define-call "mmap" sb-sys:system-area-pointer - ;; KLUDGE: #XFFFFFFFF is (void *)-1, which is the charming return - ;; value of mmap on failure. Except on 64 bit systems ... (lambda (res) - (= (sb-sys:sap-int res) #-alpha #XFFFFFFFF #+alpha #xffffffffffffffff)) + (= (sb-sys:sap-int res) #.(1- (expt 2 sb-vm::n-machine-word-bits)))) (addr sap-or-nil) (length unsigned) (prot unsigned) (flags unsigned) (fd file-descriptor) (offset sb-posix::off-t)) @@ -328,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))