Next: Unix Extensions, Previous: I/O-Extensions, Up: Packages [Contents][Index]
If 'posix
is provided (by linking in posix.o), the
following functions are defined:
If the string modes contains an r, returns an input port
capable of delivering characters from the standard output of the system
command string. Otherwise, returns an output port capable of
receiving characters which become the standard input of the system
command string. If a pipe cannot be created #f
is
returned.
Returns an input port capable of delivering characters from the
standard output of the system command string. If a pipe cannot be
created #f
is returned.
Returns an output port capable of receiving characters which become
the standard input of the system command string. If a pipe cannot
be created #f
is returned.
If this function is defined at top level, it will be called when an output pipe is closed from the other side (this is the condition under which a SIGPIPE is sent). The already closed port will be passed so that any necessary cleanup may be done. An error is not signaled when output to a pipe fails in this way, but any further output to the closed pipe will cause an error to be signaled.
Closes the pipe, rendering it incapable of delivering or accepting characters. This routine has no effect if the pipe has already been closed. The value returned is unspecified.
Returns (cons rd wd)
where rd and wd are
the read and write (port) ends of a pipe respectively.
Creates a copy of the process calling fork
. Both processes
return from fork
, but the calling (parent) process’s
fork
returns the child process’s ID whereas the child
process’s fork
returns 0.
For a discussion of IDs See Process Persona in libc.
Returns the process ID of the parent of the current process. For a process’s own ID See getpid.
Returns the real user ID of this process.
Returns the real group ID of this process.
Returns the effective group ID of this process.
Returns the effective user ID of this process.
Sets the real user ID of this process to id.
Returns #t
if successful, #f
if not.
Sets the real group ID of this process to id.
Returns #t
if successful, #f
if not.
Sets the effective group ID of this process to id.
Returns #t
if successful, #f
if not.
Sets the effective user ID of this process to id.
Returns #t
if successful, #f
if not.
The kill
function sends the signal signum to the process or
process group specified by pid. Besides the signals listed in
Standard Signals in GNU C Library, signum can also
have a value of zero to check the validity of the pid.
The pid specifies the process or process group to receive the signal:
The process whose identifier is pid.
All processes in the same process group as the sender. The sender itself does not receive the signal.
If the process is privileged, send the signal to all processes except for some special system processes. Otherwise, send the signal to all processes with the same effective user ID.
The process group whose identifier is (abs pid)
.
A process can send a signal to itself with (kill (getpid)
signum)
. If kill
is used by a process to send a signal to
itself, and the signal is not blocked, then kill
delivers at
least one signal (which might be some other pending unblocked signal
instead of the signal signum) to that process before it returns.
The return value from kill
is zero if the signal can be sent
successfully. Otherwise, no signal is sent, and a value of -1
is
returned. If pid specifies sending a signal to several processes,
kill
succeeds if it can send the signal to at least one of them.
There’s no way you can tell which of the processes got the signal or
whether all of them did.
The waitpid
function suspends execution of the current process
until a child as specified by the pid argument has exited, or
until a signal is delivered whose action is to terminate the current
process or to call a signal handling function. If a child as requested
by pid has already exited by the time of the call (a so-called
zombie process), the function returns immediately. Any system
resources used by the child are freed.
The value of pid can be:
which means to wait for any child process whose process group ID is equal to the absolute value of pid.
which means to wait for any child process; this is the same behaviour which wait exhibits.
which means to wait for any child process whose process group ID is equal to that of the calling process.
which means to wait for the child whose process ID is equal to the value of pid.
The value of options is one of the following:
WNOHANG
) which means to return immediately if no child is there
to be waited for.
WUNTRACED
) which means to also return for children which are
stopped, and whose status has not been reported.
The return value normally is the exit status of the child process,
including the exit value along with flags indicating whether a coredump
was generated or the child terminated as a result of a signal. If the
WNOHANG
option was specified and no child process is waiting to
be noticed, the value is zero. A value of #f
is returned in case
of error and errno
is set. For information about the
errno
codes See Process Completion in libc.
You can use the uname
procedure to find out some information
about the type of computer your program is running on.
Returns a vector of strings. These strings are:
Some examples are ‘"i386-ANYTHING"’, ‘"m68k-hp"’, ‘"sparc-sun"’, ‘"m68k-sun"’, ‘"m68k-sony"’ and ‘"mips-dec"’.
Returns a vector of information for the entry for NAME
,
UID
, or the next entry if no argument is given. The
information is:
#f
, in
which case the interpretation is system-dependent.
#f
, indicating that the system default should be used.
Rewinds the pw entry table back to the begining.
Returns a vector of information for the entry for NAME
,
UID
, or the next entry if no argument is given. The
information is:
Rewinds the group entry table back to the begining.
Returns a vector of all the supplementary group IDs of the process.
The link
function makes a new link to the existing file named by
oldname, under the new name newname.
link
returns a value of #t
if it is successful and
#f
on failure.
The chown
function changes the owner of the file filename
to owner, and its group owner to group.
chown
returns a value of #t
if it is successful and
#f
on failure.
If port port is associated with a terminal device, returns a
string containing the file name of termainal device; otherwise
#f
.
Next: Unix Extensions, Previous: I/O-Extensions, Up: Packages [Contents][Index]