X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Frun-program.lisp;h=5088023d460c28544ece64e251d27f47f13bde6e;hb=b0a7abdf2bd6f2d66fcce97196024cdb0e1a1886;hp=99a75971528d6e56a46811cd27da66c0e4665311;hpb=76237af144bef52bc2e391c90970a1747cdf0a9e;p=sbcl.git diff --git a/src/code/run-program.lisp b/src/code/run-program.lisp index 99a7597..5088023 100644 --- a/src/code/run-program.lisp +++ b/src/code/run-program.lisp @@ -98,7 +98,7 @@ (rusage sb-alien:int)) (defun wait3 (&optional do-not-hang check-for-stopped) - #!+sb-doc + #+sb-doc "Return any available status information on child process. " (multiple-value-bind (pid status) (c-wait3 (logior (if do-not-hang @@ -137,7 +137,7 @@ ;;;; process control stuff (defvar *active-processes* nil - #!+sb-doc + #+sb-doc "List of process structures for all active processes.") (defvar *active-processes-lock* @@ -174,55 +174,55 @@ (process-status process))) process) -#!+sb-doc +#+sb-doc (setf (documentation 'process-p 'function) "T if OBJECT is a PROCESS, NIL otherwise.") -#!+sb-doc +#+sb-doc (setf (documentation 'process-pid 'function) "The pid of the child process.") (defun process-status (process) - #!+sb-doc + #+sb-doc "Return the current status of PROCESS. The result is one of :RUNNING, :STOPPED, :EXITED, or :SIGNALED." (get-processes-status-changes) (process-%status process)) -#!+sb-doc +#+sb-doc (setf (documentation 'process-exit-code 'function) "The exit code or the signal of a stopped process.") -#!+sb-doc +#+sb-doc (setf (documentation 'process-core-dumped 'function) "T if a core image was dumped by the process.") -#!+sb-doc +#+sb-doc (setf (documentation 'process-pty 'function) "The pty stream of the process or NIL.") -#!+sb-doc +#+sb-doc (setf (documentation 'process-input 'function) "The input stream of the process or NIL.") -#!+sb-doc +#+sb-doc (setf (documentation 'process-output 'function) "The output stream of the process or NIL.") -#!+sb-doc +#+sb-doc (setf (documentation 'process-error 'function) "The error stream of the process or NIL.") -#!+sb-doc +#+sb-doc (setf (documentation 'process-status-hook 'function) "A function that is called when PROCESS changes its status. The function is called with PROCESS as its only argument.") -#!+sb-doc +#+sb-doc (setf (documentation 'process-plist 'function) "A place for clients to stash things.") (defun process-wait (process &optional check-for-stopped) - #!+sb-doc + #+sb-doc "Wait for PROCESS to quit running for some reason. When CHECK-FOR-STOPPED is T, also returns when PROCESS is stopped. Returns PROCESS." @@ -253,7 +253,7 @@ The function is called with PROCESS as its only argument.") (process-pid proc)) (defun process-kill (process signal &optional (whom :pid)) - #!+sb-doc + #+sb-doc "Hand SIGNAL to PROCESS. If WHOM is :PID, use the kill Unix system call. If WHOM is :PROCESS-GROUP, use the killpg Unix system call. If WHOM is :PTY-PROCESS-GROUP deliver the signal to whichever process group is @@ -290,7 +290,7 @@ The function is called with PROCESS as its only argument.") t))))) (defun process-alive-p (process) - #!+sb-doc + #+sb-doc "Return T if PROCESS is still alive, NIL otherwise." (let ((status (process-status process))) (if (or (eq status :running) @@ -299,7 +299,7 @@ The function is called with PROCESS as its only argument.") nil))) (defun process-close (process) - #!+sb-doc + #+sb-doc "Close all streams connected to PROCESS and stop maintaining the status slot." (macrolet ((frob (stream abort) `(when ,stream (close ,stream :abort ,abort)))) @@ -384,6 +384,7 @@ The function is called with PROCESS as its only argument.") (copy-descriptor-to-stream new-fd pty cookie))) (values name (sb-sys:make-fd-stream master :input t :output t + :element-type :default :dual-channel-p t))))) (defmacro round-bytes-to-words (n) @@ -457,7 +458,7 @@ The function is called with PROCESS as its only argument.") (defun find-executable-in-search-path (pathname &optional (search-path (posix-getenv "PATH"))) - #!+sb-doc + #+sb-doc "Find the first executable file matching PATHNAME in any of the colon-separated list of pathnames SEARCH-PATH" (loop for end = (position #\: search-path :start (if end (1+ end) 0)) @@ -532,7 +533,7 @@ colon-separated list of pathnames SEARCH-PATH" (error :output) (if-error-exists :error) status-hook) - #!+sb-doc + #+sb-doc "RUN-PROGRAM creates a new Unix process running the Unix program found in the file specified by the PROGRAM argument. ARGS are the standard arguments that can be passed to a Unix program. For no arguments, use NIL @@ -777,12 +778,14 @@ colon-separated list of pathnames SEARCH-PATH" (:input (push read-fd *close-in-parent*) (push write-fd *close-on-error*) - (let ((stream (sb-sys:make-fd-stream write-fd :output t))) + (let ((stream (sb-sys:make-fd-stream write-fd :output t + :element-type :default))) (values read-fd stream))) (:output (push read-fd *close-on-error*) (push write-fd *close-in-parent*) - (let ((stream (sb-sys:make-fd-stream read-fd :input t))) + (let ((stream (sb-sys:make-fd-stream read-fd :input t + :element-type :default))) (values write-fd stream))) (t (sb-unix:unix-close read-fd)