From ea4bcd7b5427b10a9b26168913621dfc5f2c5c63 Mon Sep 17 00:00:00 2001 From: "Greg J. Badros" Date: Mon, 13 Dec 1999 02:54:56 +0000 Subject: [PATCH] * popen.scm, slib.scm: Added some docstrings for procedures that were primitives that I encountered in posix.texi. --- ice-9/popen.scm | 7 +++++++ ice-9/slib.scm | 13 ++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ice-9/popen.scm b/ice-9/popen.scm index 0c936151f..f38ab76a0 100644 --- a/ice-9/popen.scm +++ b/ice-9/popen.scm @@ -40,6 +40,10 @@ pid)))))) (define-public (open-pipe command mode) + "Executes the shell command @var{command} (a string) in a subprocess. +A pipe to the process is created and returned. @var{modes} specifies +whether an input or output pipe to the process is created: it should +be the value of @code{OPEN_READ} or @code{OPEN_WRITE}." (let* ((port/pid (open-process mode "/bin/sh" "-c" command)) (port (car port/pid))) (pipe-guardian port) @@ -56,6 +60,9 @@ (cdr (waitpid (cdr port/pid)))) (define-public (close-pipe p) + "Closes the pipe created by @code{open-pipe}, then waits for the process +to terminate and returns its status value, @xref{Processes, waitpid}, for +information on how to interpret this value." (let ((pid (fetch-pid p))) (if (not pid) (error "close-pipe: pipe not in table")) diff --git a/ice-9/slib.scm b/ice-9/slib.scm index d03ae86d3..cbd4eab45 100644 --- a/ice-9/slib.scm +++ b/ice-9/slib.scm @@ -212,7 +212,18 @@ '*sc-expander* '(define))) -(define (software-type) 'UNIX) +(define (software-type) + "Return a symbol describing the current platform's operating system. +This may be one of AIX, VMS, UNIX, COHERENT, WINDOWS, MS-DOS, OS/2, +THINKC, AMIGA, ATARIST, MACH, or ACORN. + +Note that most varieties of Unix are considered to be simply \"UNIX\". +That is because when a program depends on features that are not present +on every operating system, it is usually better to test for the presence +or absence of that specific feature. The return value of +@code{software-type} should only be used for this purpose when there is +no other easy or unambiguous way of detecting such features." + 'UNIX) (slib:load (in-vicinity (library-vicinity) "require.scm"))