Changeset 10636


Ignore:
Timestamp:
Sep 8, 2008, 5:57:04 AM (11 years ago)
Author:
gb
Message:

Don't use syscall interfaces (in the few places that we did).
Conditionalize for Windows.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/l1-streams.lisp

    r10491 r10636  
    1717
    1818(in-package "CCL")
    19 
    20 (eval-when (:compile-toplevel :execute)
    21   #+linuxppc-target
    22   (require "PPC-LINUX-SYSCALLS")
    23   #+linuxx8664-target
    24   (require "X8664-LINUX-SYSCALLS")
    25   #+darwinppc-target
    26   (require "DARWINPPC-SYSCALLS")
    27   #+darwinx8632-target
    28   (require "DARWINX8632-SYSCALLS")
    29   #+darwinx8664-target
    30   (require "DARWINX8664-SYSCALLS")
    31   #+freebsdx8664-target
    32   (require "X8664-FREEBSD-SYSCALLS")
    33   #+solarisx8664-target
    34   (require "X8664-SOLARIS-SYSCALLS"))
    35 
    3619;;;
    3720
     
    33163299
    33173300(defun optimal-buffer-size (fd element-type)
    3318   (let* ((nominal (or (nth-value 6 (%fstat fd)) *elements-per-buffer*))
    3319          (octets (case (%unix-fd-kind fd)
     3301  #+windows-target (declare (ignore fd))
     3302  (let* ((nominal #-windows-target (or (nth-value 6 (%fstat fd)) *elements-per-buffer*))
     3303         (octets #+windows-target #$BUFSIZ
     3304                 #-windows-target
     3305                 (case (%unix-fd-kind fd)
    33203306                   (:pipe (#_fpathconf fd #$_PC_PIPE_BUF))
    33213307                   (:socket
     
    52745260  #-freebsd-target
    52755261  (rlet ((arg (* :char) (%null-ptr)))
    5276     (when (zerop (syscall syscalls::ioctl fd #$FIONREAD arg))
     5262    (when (zerop (int-errno-call (#_ioctl fd #$FIONREAD :address arg)))
    52775263      (let* ((avail (pref arg :long)))
    52785264        (and (> avail 0) avail)))))
     
    53145300
    53155301(defun process-input-would-block (fd)
     5302  #+windows-target (declare (ignore fd))
     5303  #+windows-target t
     5304  #-windows-target
    53165305  (if (logtest #$O_NONBLOCK (the fixnum (fd-get-flags fd)))
    53175306    (process-input-wait fd)
     
    53465335
    53475336(defun process-output-would-block (fd)
     5337  #+windows-target (declare (ignore fd))
     5338  #+windows-target t
     5339  #-windows-target
    53485340  (if (logtest #$O_NONBLOCK (the fixnum (fd-get-flags fd)))
    53495341    (process-output-wait fd)
     
    53895381    (setf (pref (paref pollfds (:* (:struct :pollfd)) 0) :pollfd.fd) fd
    53905382          (pref (paref pollfds (:* (:struct :pollfd)) 0) :pollfd.events) #$POLLIN)
    5391     (let* ((res (syscall syscalls::poll pollfds 1 (or milliseconds -1))))
     5383    (let* ((res (int-errno-call (#_poll pollfds 1 (or milliseconds -1)))))
    53925384      (declare (fixnum res))
    53935385      (values (> res 0) res))))
     
    53985390    (setf (pref (paref pollfds (:* (:struct :pollfd)) 0) :pollfd.fd) fd
    53995391          (pref (paref pollfds (:* (:struct :pollfd)) 0) :pollfd.events) #$POLLOUT)
    5400     (let* ((res (syscall syscalls::poll pollfds 1 (or milliseconds -1))))
     5392    (let* ((res (int-errno-call (#_poll pollfds 1 (or milliseconds -1)))))
    54015393      (declare (fixnum res))
    54025394      (values (> res 0)  res))))
Note: See TracChangeset for help on using the changeset viewer.