"BEEP" "BITS"
"BYTES"
"BREAKPOINT-ERROR"
- "C-PROCEDURE"
"CLOSE-SHARED-OBJECTS"
"COMPILER-VERSION"
"DEALLOCATE-SYSTEM-MEMORY"
"MEMMOVE"
"NATURALIZE-BOOLEAN" "NATURALIZE-INTEGER"
"OS-COLD-INIT-OR-REINIT" "OS-CONTEXT-T" "OUTPUT-RAW-BYTES"
- "POINTER" "POINTER<" "POINTER>"
"READ-N-BYTES" "REALLOCATE-SYSTEM-MEMORY" "RECORD-SIZE"
"REMOVE-FD-HANDLER"
"REOPEN-SHARED-OBJECTS"
"SAP-REF-SAP" "SAP-REF-SINGLE"
"SAP<" "SAP<=" "SAP=" "SAP>" "SAP>="
"SCRUB-CONTROL-STACK" "SERVE-ALL-EVENTS"
- "SERVE-EVENT" "SERVER" "SERVER-MESSAGE"
+ "SERVE-EVENT"
"SIGNED-SAP-REF-16" "SIGNED-SAP-REF-32"
"SIGNED-SAP-REF-64" "SIGNED-SAP-REF-WORD" "SIGNED-SAP-REF-8"
;; FIXME: STRUCTURE!OBJECT stuff probably belongs in SB!KERNEL.
"SYSTEM-INTERNAL-RUN-TIME"
"UNDEFINED-FOREIGN-SYMBOLS-P"
"UPDATE-LINKAGE-TABLE" "VECTOR-SAP"
- "WAIT-UNTIL-FD-USABLE" "WITH-ENABLED-INTERRUPTS"
+ "WAIT-UNTIL-FD-USABLE"
"WITH-FD-HANDLER"
"WITH-INTERRUPTS" "WITH-PINNED-OBJECTS" "WITHOUT-GCING"
- "WITHOUT-INTERRUPTS" "WORDS"
- "ALLOCATE-SYSTEM-MEMORY-AT"))
+ "WITHOUT-INTERRUPTS" "WORDS"))
#s(sb-cold:package-data
:name "SB!UNIX"
'(:ansi-cl :section (15 1 2 1))
'(:ansi-cl :section (15 1 2 2)))))
-(define-condition io-timeout (stream-error)
- ((direction :reader io-timeout-direction :initarg :direction))
- (:report
- (lambda (condition stream)
- (declare (type stream stream))
- (format stream
- "I/O timeout ~(~A~)ing ~S"
- (io-timeout-direction condition)
- (stream-error-stream condition)))))
-
(define-condition namestring-parse-error (parse-error)
((complaint :reader namestring-parse-error-complaint :initarg :complaint)
(args :reader namestring-parse-error-args :initarg :args :initform nil)
(define-condition timeout (serious-condition) ())
+(define-condition io-timeout (stream-error timeout)
+ ((direction :reader io-timeout-direction :initarg :direction))
+ (:report
+ (lambda (condition stream)
+ (declare (type stream stream))
+ (format stream
+ "I/O timeout ~(~A~)ing ~S"
+ (io-timeout-direction condition)
+ (stream-error-stream condition)))))
+
(define-condition declaration-type-conflict-error (reference-condition
simple-error)
()
end)
(fd-stream-output-later stream))))))
(unless (fd-stream-output-later stream)
- (sb!sys:remove-fd-handler (fd-stream-handler stream))
+ (remove-fd-handler (fd-stream-handler stream))
(setf (fd-stream-handler stream) nil)))
;;; Arange to output the string when we can write on the file descriptor.
(setf (fd-stream-output-later stream)
(list (list base start end reuse-sap)))
(setf (fd-stream-handler stream)
- (sb!sys:add-fd-handler (fd-stream-fd stream)
+ (add-fd-handler (fd-stream-fd stream)
:output
(lambda (fd)
(declare (ignore fd))
;;(not (sb!win32:fd-listen fd)), as was originally here. See
;;comment in `sysread-may-block-p'.
(when (sysread-may-block-p stream)
- (unless (sb!sys:wait-until-fd-usable
+ (unless (wait-until-fd-usable
fd :input (fd-stream-timeout stream))
(error 'io-timeout :stream stream :direction :read)))
(multiple-value-bind (count errno)
(sb!unix:unix-read fd
- (sb!sys:int-sap (+ (sb!sys:sap-int ibuf-sap) tail))
+ (int-sap (+ (sap-int ibuf-sap) tail))
(- buflen tail))
(cond ((null count)
(if #!-win32 (eql errno sb!unix:ewouldblock) #!+win32 t #!-win32
(progn
- (unless (sb!sys:wait-until-fd-usable
+ (unless (wait-until-fd-usable
fd :input (fd-stream-timeout stream))
(error 'io-timeout :stream stream :direction :read))
(refill-buffer/fd stream))
(declare (optimize (speed 3) (safety 0)))
(let* ((length (length string))
(buffer (make-array (* (1+ length) ,size) :element-type '(unsigned-byte 8)))
- (sap (sb!sys:vector-sap buffer))
+ (sap (vector-sap buffer))
(tail 0)
(stream ,name))
(declare (type index length tail)
(the index ,out-size-expr)))))
(tail 0)
(buffer (make-array buffer-length :element-type '(unsigned-byte 8)))
- (sap (sb!sys:vector-sap buffer))
+ (sap (vector-sap buffer))
stream)
(declare (type index length buffer-length tail)
(type system-area-pointer sap)
(:close
(cond (arg1 ; We got us an abort on our hands.
(when (fd-stream-handler fd-stream)
- (sb!sys:remove-fd-handler (fd-stream-handler fd-stream))
+ (remove-fd-handler (fd-stream-handler fd-stream))
(setf (fd-stream-handler fd-stream) nil))
;; We can't do anything unless we know what file were
;; dealing with, and we don't want to do anything
(flush-output-buffer fd-stream))
(:finish-output
(flush-output-buffer fd-stream)
- (do ()
- ((null (fd-stream-output-later fd-stream)))
- (sb!sys:serve-all-events)))
+ (finish-fd-stream-output fd-stream))
(:element-type
(fd-stream-element-type fd-stream))
(:external-format
(:file-position
(fd-stream-file-position fd-stream arg1))))
+(defun finish-fd-stream-output (stream)
+ (do ()
+ ((null (fd-stream-output-later stream)))
+ (serve-all-events)))
+
(defun fd-stream-file-position (stream &optional newpos)
(declare (type fd-stream stream)
(type (or (alien sb!unix:off-t) (member nil :start :end)) newpos))
(if (null newpos)
- (sb!sys:without-interrupts
+ (without-interrupts
;; First, find the position of the UNIX file descriptor in the file.
(multiple-value-bind (posn errno)
(sb!unix:unix-lseek (fd-stream-fd stream) 0 sb!unix:l_incr)
((eq errno sb!unix:espipe)
nil)
(t
- (sb!sys:with-interrupts
+ (with-interrupts
(simple-stream-perror "failure in Unix lseek() on ~S"
stream
errno))))))
;; move the file pointer before writing this stuff, it will be
;; written in the wrong location.
(flush-output-buffer stream)
- (do ()
- ((null (fd-stream-output-later stream)))
- (sb!sys:serve-all-events))
+ (finish-fd-stream-output stream)
;; Clear out any pending input to force the next read to go to
;; the disk.
(setf (fd-stream-unread stream) nil)
;;; Magically converted by the compiler into a break instruction.
(defun receive-pending-interrupt ()
(receive-pending-interrupt))
-\f
-;;; stale code which I'm insufficiently motivated to test -- WHN 19990714
-#|
-;;;; WITH-ENABLED-INTERRUPTS
-
-(defmacro with-enabled-interrupts (interrupt-list &body body)
- #!+sb-doc
- "With-enabled-interrupts ({(interrupt function)}*) {form}*
- Establish function as a handler for the Unix signal interrupt which
- should be a number between 1 and 31 inclusive."
- (let ((il (gensym))
- (it (gensym)))
- `(let ((,il NIL))
- (unwind-protect
- (progn
- ,@(do* ((item interrupt-list (cdr item))
- (intr (caar item) (caar item))
- (ifcn (cadar item) (cadar item))
- (forms NIL))
- ((null item) (nreverse forms))
- (when (symbolp intr)
- (setq intr (symbol-value intr)))
- (push `(push `(,,intr ,(enable-interrupt ,intr ,ifcn)) ,il)
- forms))
- ,@body)
- (dolist (,it (nreverse ,il))
- (enable-interrupt (car ,it) (cadr ,it)))))))
-|#