(void-syscall ("access" c-string int) path mode))
;;; values for the second argument to UNIX-LSEEK
+;;; Note that nowadays these are called SEEK_SET, SEEK_CUR, and SEEK_END
(defconstant l_set 0) ; to set the file pointer
(defconstant l_incr 1) ; to increment the file pointer
(defconstant l_xtnd 2) ; to extend the file size
(%extract-stat-results (addr buf))
fd (addr buf))))
+#!-win32
(defun fd-type (fd)
(declare (type unix-fd fd))
(let ((fmt (logand
(defun nanosleep (secs nsecs)
(with-alien ((req (struct timespec))
(rem (struct timespec)))
- (setf (slot req 'tv-sec) secs)
- (setf (slot req 'tv-nsec) nsecs)
+ (setf (slot req 'tv-sec) secs
+ (slot req 'tv-nsec) nsecs)
(loop while (and (eql sb!unix:eintr
(nth-value 1
(int-syscall ("nanosleep" (* (struct timespec))
(rem-nsec (slot rem 'tv-nsec)))
(when (or (> secs rem-sec)
(and (= secs rem-sec) (>= nsecs rem-nsec)))
- (setf secs rem-sec
+ ;; Update for next round.
+ (setf secs rem-sec
nsecs rem-nsec)
t)))
- do (rotatef req rem))))
+ do (setf (slot req 'tv-sec) (slot rem 'tv-sec)
+ (slot req 'tv-nsec) (slot rem 'tv-nsec)))))
(defun unix-get-seconds-west (secs)
(multiple-value-bind (ignore seconds dst) (get-timezone secs)