X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Funix.lisp;h=be0e22824945902fb1470e62f9e86b4e0c528d73;hb=8bb8f286dbacf1792a26de693c795d268516672c;hp=09146aba5532bd387c9ad648a981731dd79e6dd2;hpb=6584a2c88efaa6931083721adae2f9f10e0fefd5;p=sbcl.git diff --git a/src/code/unix.lisp b/src/code/unix.lisp index 09146ab..be0e228 100644 --- a/src/code/unix.lisp +++ b/src/code/unix.lisp @@ -167,7 +167,12 @@ SYSCALL-FORM. Repeat evaluation of SYSCALL-FORM if it is interrupted." (declare (type unix-pathname path) (type fixnum flags) (type unix-file-mode mode)) - (int-syscall ("open" c-string int int) path (logior #!+win32 o_binary flags) mode)) + (int-syscall ("open" c-string int int) + path + (logior #!+win32 o_binary + #!+largefile o_largefile + flags) + mode)) ;;; UNIX-CLOSE accepts a file descriptor and attempts to close the file ;;; associated with it. @@ -180,10 +185,19 @@ SYSCALL-FORM. Repeat evaluation of SYSCALL-FORM if it is interrupted." ;; A time value that is accurate to the nearest ;; microsecond but also has a range of years. +;; CLH: Note that tv-usec used to be a time-t, but that this seems +;; problematic on Darwin x86-64 (and wrong). Trying suseconds-t. +#!-win32 +(define-alien-type nil + (struct timeval + (tv-sec time-t) ; seconds + (tv-usec suseconds-t))) ; and microseconds + +#!+win32 (define-alien-type nil - (struct timeval - (tv-sec time-t) ; seconds - (tv-usec time-t))) ; and microseconds + (struct timeval + (tv-sec time-t) ; seconds + (tv-usec long))) ; and microseconds ;;;; resourcebits.h @@ -257,7 +271,9 @@ SYSCALL-FORM. Repeat evaluation of SYSCALL-FORM if it is interrupted." " (declare (type unix-fd fd) (type (integer 0 2) whence)) - (let ((result (alien-funcall (extern-alien "lseek" (function off-t int off-t int)) + (let ((result (alien-funcall (extern-alien #!-largefile "lseek" + #!+largefile "lseek_largefile" + (function off-t int off-t int)) fd offset whence))) (if (minusp result ) (values nil (get-errno)) @@ -614,23 +630,19 @@ SYSCALL-FORM. Repeat evaluation of SYSCALL-FORM if it is interrupted." ;;; longer than 32 bits anyway, right?":-| (define-alien-type nil (struct wrapped_stat - #!-mips - (st-dev unsigned-int) ; would be dev-t in a real stat - #!+mips - (st-dev unsigned-long) ; this is _not_ a dev-t on mips + (st-dev #!-(or mips largefile) unsigned-int + #!+mips unsigned-long + #!+largefile dev-t) (st-ino ino-t) (st-mode mode-t) (st-nlink nlink-t) (st-uid uid-t) (st-gid gid-t) - #!-mips - (st-rdev unsigned-int) ; would be dev-t in a real stat - #!+mips - (st-rdev unsigned-long) ; this is _not_ a dev-t on mips - #!-mips - (st-size unsigned-int) ; would be off-t in a real stat - #!+mips - (st-size off-t) + (st-rdev #!-(or mips largefile) unsigned-int + #!+mips unsigned-long + #!+largefile dev-t) + (st-size #!-(or mips largefile) unsigned-int + #!+(or mips largefile) off-t) (st-blksize unsigned-long) (st-blocks unsigned-long) (st-atime time-t)