0.8.0.24:
[sbcl.git] / src / code / unix.lisp
index e886257..1e973f3 100644 (file)
 (defconstant l_incr 1) ; to increment the file pointer
 (defconstant l_xtnd 2) ; to extend the file size
 
+;;; Is a stream interactive?
+(defun unix-isatty (fd)
+  (declare (type unix-fd fd))
+  (int-syscall ("isatty" int) fd))
+
 ;;; Accept a file descriptor and move the file pointer ahead
 ;;; a certain offset for that file. WHENCE can be any of the following:
 ;;;  L_SET     Set the file pointer.
                        (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))