Ignore:
Timestamp:
Sep 10, 2008, 4:11:39 AM (11 years ago)
Author:
gb
Message:

Conditionalize for windows, share pipe implementation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/linux-files.lisp

    r10668 r10683  
    428428    "unknown"))
    429429
     430#-windows-target
    430431(defun copy-file-attributes (source-path dest-path)
    431432  "Copy the mode, owner, group and modification time of source-path to dest-path.
     
    878879(defloadvar *max-os-open-files* #-windows-target (#_getdtablesize) #+windows-target 32)
    879880
     881(defun pipe ()
     882  ;;  (rlet ((filedes (:array :int 2)))
     883  (%stack-block ((filedes 8))
     884    (let* ((status (ff-call (%kernel-import target::kernel-import-lisp-pipe)
     885                            :address filedes :int))
     886           (errno (if (eql status 0) 0 (%get-errno))))
     887      (unless (zerop status)
     888        (when (or (eql errno (- #$EMFILE))
     889                  (eql errno (- #$ENFILE)))
     890          (gc)
     891          (drain-termination-queue)
     892          (setq status (ff-call (%kernel-import target::kernel-import-lisp-pipe)
     893                            :address filedes :int)
     894                errno (if (zerop status) 0 (%get-errno)))))
     895      (if (zerop status)
     896        (values (paref filedes (:array :int)  0) (paref filedes (:array :int)  1))
     897        (%errno-disp errno)))))
     898
    880899#-windows-target
    881900(progn
     
    894913    (#_close fd)))
    895914
    896 (defun pipe ()
    897   ;;  (rlet ((filedes (:array :int 2)))
    898   (%stack-block ((filedes 8))
    899     (let* ((status (#_pipe filedes))
    900            (errno (if (eql status 0) 0 (%get-errno))))
    901       (unless (zerop status)
    902         (when (or (eql errno (- #$EMFILE))
    903                   (eql errno (- #$ENFILE)))
    904           (gc)
    905           (drain-termination-queue)
    906           (setq status (#_pipe filedes)
    907                 errno (if (zerop status) 0 (%get-errno)))))
    908       (if (zerop status)
    909         (values (paref filedes (:array :int)  0) (paref filedes (:array :int)  1))
    910         (%errno-disp errno)))))
     915
    911916
    912917
     
    15201525
    15211526
    1522 (defun pipe ()
    1523   (%stack-block ((filedes 8))
    1524     (syscall syscalls::pipe filedes)
    1525     (values (paref filedes (:array :int)  0) (paref filedes (:array :int)  1))))
     1527
    15261528
    15271529(defun run-external-process (proc in-fd out-fd error-fd &optional env)
Note: See TracChangeset for help on using the changeset viewer.