X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fsb-posix%2Finterface.lisp;h=4abe103894867940248e8def1828b4ea6d1f4c29;hb=2e9def5473ebcdf7b0d26705c252da476b7ea145;hp=98b4a5e9fcc93b2f7d1a73a3a6bab6f87e478ce0;hpb=506253505641855dc8bb87033f7af894904f848b;p=sbcl.git diff --git a/contrib/sb-posix/interface.lisp b/contrib/sb-posix/interface.lisp index 98b4a5e..4abe103 100644 --- a/contrib/sb-posix/interface.lisp +++ b/contrib/sb-posix/interface.lisp @@ -25,7 +25,7 @@ (define-call "fchown" int minusp (fd file-descriptor) (owner sb-posix::uid-t) (group sb-posix::gid-t)) (define-call "link" int minusp (oldpath filename) (newpath filename)) -;; no lchown on Darwin +;;; no lchown on Darwin #-darwin (define-call "lchown" int minusp (pathname filename) (owner sb-posix::uid-t) (group sb-posix::gid-t)) @@ -35,7 +35,15 @@ (define-call "symlink" int minusp (oldpath filename) (newpath filename)) (define-call "unlink" int minusp (pathname filename)) - +(define-call "opendir" (* t) null-alien (pathname filename)) +(define-call "readdir" (* t) + ;; readdir() has the worst error convention in the world. It's just + ;; too painful to support. (return is NULL _and_ errno "unchanged" + ;; is not an error, it's EOF). + not + (dir (* t))) +(define-call "closedir" int minusp (dir (* t))) + ;;; uid, gid (define-call "geteuid" sb-posix::uid-t not) ;"always successful", it says @@ -76,17 +84,20 @@ (pid sb-posix::pid-t) (pgid sb-posix::pid-t)) (define-call "setpgrp" int minusp) -;;; mmap +;;; 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)) (addr sap-or-nil) (length unsigned) (prot unsigned) - (flags unsigned) (fd file-descriptor) (offset int)) + (flags unsigned) (fd file-descriptor) (offset sb-posix::off-t)) (define-call "munmap" int minusp (start sb-sys:system-area-pointer) (length unsigned)) +(define-call "msync" int minusp + (addr sb-sys:system-area-pointer) (length unsigned) (flags int)) + (define-call "getpagesize" int minusp)