X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fcode%2Funix.lisp;h=382d03409825c62836c7afcefed3f13f40869a0f;hb=e411bd41397e1df2423838a4f9c2fdaa27727e93;hp=4dce234153bbf9438074fd0824d7a839a4d3d07b;hpb=b387f6ae447b55e203f47fc40af4a36e756fe345;p=sbcl.git diff --git a/src/code/unix.lisp b/src/code/unix.lisp index 4dce234..382d034 100644 --- a/src/code/unix.lisp +++ b/src/code/unix.lisp @@ -216,15 +216,8 @@ ;;; L_XTND Extend the file size. (defun unix-lseek (fd offset whence) (declare (type unix-fd fd) - (type (unsigned-byte 32) offset) (type (integer 0 2) whence)) - #!-(and x86 bsd) - (int-syscall ("lseek" int off-t int) fd offset whence) - ;; Need a 64-bit return value type for this. TBD. For now, - ;; don't use this with any 2G+ partitions. - #!+(and x86 bsd) - (int-syscall ("lseek" int unsigned-long unsigned-long int) - fd offset 0 whence)) + (int-syscall ("lseek" int off-t int) fd offset whence)) ;;; UNIX-READ accepts a file descriptor, a buffer, and the length to read. ;;; It attempts to read len bytes from the device associated with fd @@ -407,8 +400,8 @@ ;;; information. (defun unix-ioctl (fd cmd arg) (declare (type unix-fd fd) - (type (unsigned-byte 32) cmd)) - (void-syscall ("ioctl" int unsigned-int (* char)) fd cmd arg)) + (type (signed-byte 32) cmd)) + (void-syscall ("ioctl" int signed-int (* char)) fd cmd arg)) ;;;; sys/resource.h @@ -760,13 +753,11 @@ (slot (slot itvo 'it-value) 'tv-usec)) which (alien-sap (addr itvn))(alien-sap (addr itvo)))))) -(defmacro with-timeout (expires &body body) +(defmacro sb!ext::with-timeout (expires &body body) "Execute the body, interrupting it with a SIGALRM after at least EXPIRES seconds have passed. Uses Unix setitimer(), restoring any previous timer after the body has finished executing" - (let ((saved-seconds (gensym "SAVED-SECONDS")) - (saved-useconds (gensym "SAVED-USECONDS")) - (s (gensym "S")) (u (gensym "U"))) + (with-unique-names (saved-seconds saved-useconds s u) `(let (- ,saved-seconds ,saved-useconds) (multiple-value-setq (- - - ,saved-seconds ,saved-useconds) (unix-getitimer :real))