Replaces the current process with a new image running the program
cmd
, with arguments in the list args
. The first
argument, by convention, should be the file name being executed -
an error is signaled if args
is null. The command and
arguments may be symbols or numbers in addition to strings for
convenience. Equivalent to execvp
.
Runs the given command cmd
in a subprocess, with arguments
args
. Uses a flat representation of arguments to avoid
duplicates, so unlike execute
automatically includes
cmd
as the first argument program name. As a convenience,
cmd
itself may be a list which is appended to any arguments.
The stdin
, stdout
and stderr
will be
inherited from the current process. Use
call-with-process-io
if you need to capture or manipulate
the subprocess IO.
Examples:
(system "date")
Mon Aug 28 23:25:11 JST 2017
(system "ls" "/usr/")
bin games include lib local sbin share src
(system '(dc -e "2 2 + p"))
4
Equivalent to system
, but returns #t
on success
and #f
on failure.
Runs the program command
in a subprocess and calls
proc
on 4 arguments: the pid
, stdin
,
stdout
and stderr
of the subprocess. command
should be a list beginning with the program name followed by any
args, which may be symbols or numbers for convenience as with
system
, or a string which is split on white-space. If
provided, the optional child-proc
is called in the child
process, after ports have been duplicated but before the command
is executed, to allow for actions such as port remapping.
Utility to run command
and return the accumulated output as
a bytevector.
Utility to run command
and return the accumulated output as
a string.
Utility to run command
and return the accumulated output as
a sexp, as from read
.
Utility to run command
and return a list of three values:
the accumulated output as a string, the error output as a string,
and the exit status as an integer.
Utility to run command
and return a list of two values:
the accumulated output as a string, the error output as a string.
Utility to run command
and return the output as a list of
strings, one for each line (trailing newlines not included).An interface to spawning processes and sending and
receiving signals between processes.The siginfo_t struct is used to return info about the status,
process and user info of a called signal handler.
Sets the signal handler for signal
to handler
and returns the old handler. handler
should be a procedure
of one argument, the signal number, the value #t
for
the default signal handler, or #f
for no handler.
Signal handlers are queued run in a dedicated thread after the
system handler has returned.
The sigset_t struct represents a set of signals for masking.
Send a signal/alarm
signal to the current process
after unsigned-int
seconds have elapsed.
Suspend the current process for unsigned-int
seconds.
See SRFI-18
thread-sleep!
for a light-weight sleep for only the
current thread.
Fork the current process. Returns 0
for the newly
created process, and the process id of the new process for the
parent. If multiple threads are active, they are forked as well.
Use fork
to also kill all other threads.
Wait on the process pid
, or any child process if pid
is -1
. options
should be 0, or wait/no-hang
to return immediately if no processes have reported status. Returns
a list whose first element is the actual pid
reporting, and
the second element is the integer status.
Send a signal to the given process.Exits the current process immediately. Finalizers are not run.Replace the current process with the given command. Finalizers are not run.
Returns the current process id.
Returns the parent process id.