Next: Terminals and Ptys, Previous: Processes, Up: POSIX
Procedures to raise, handle and wait for signals.
Sends a signal to the specified process or group of processes.
pid specifies the processes to which the signal is sent:
- pid greater than 0
- The process whose identifier is pid.
- pid equal to 0
- All processes in the current process group.
- pid less than -1
- The process group whose identifier is -pid
- pid equal to -1
- If the process is privileged, all processes except for some special system processes. Otherwise, all processes with the current effective user ID.
sig should be specified using a variable corresponding to the Unix symbolic name, e.g.,
A full list of signals on the GNU system may be found in Standard Signals.
Sends a specified signal sig to the current process, where sig is as described for the
kill
procedure.
Install or report the signal handler for a specified signal.
signum is the signal number, which can be specified using the value of variables such as
SIGINT
.If handler is omitted,
sigaction
returns a pair: the CAR is the current signal hander, which will be either an integer with the valueSIG_DFL
(default action) orSIG_IGN
(ignore), or the Scheme procedure which handles the signal, or#f
if a non-Scheme procedure handles the signal. The CDR contains the currentsigaction
flags for the handler.If handler is provided, it is installed as the new handler for signum. handler can be a Scheme procedure taking one argument, or the value of
SIG_DFL
(default action) orSIG_IGN
(ignore), or#f
to restore whatever signal handler was installed beforesigaction
was first used. When a scheme procedure has been specified, that procedure will run in the given thread. When no thread has been given, the thread that made this call tosigaction
is used.flags is a
logior
(see Bitwise Operations) of the following (where provided by the system), or0
for none.— Variable: SA_NOCLDSTOP
By default,
SIGCHLD
is signalled when a child process stops (ie. receivesSIGSTOP
), and when a child process terminates. With theSA_NOCLDSTOP
flag,SIGCHLD
is only signalled for termination, not stopping.
SA_NOCLDSTOP
has no effect on signals other thanSIGCHLD
.— Variable: SA_RESTART
If a signal occurs while in a system call, deliver the signal then restart the system call (as opposed to returning an
EINTR
error from that call).Guile always enables this flag where available, no matter what flags are specified. This avoids spurious error returns in low level operations.
The return value is a pair with information about the old handler as described above.
This interface does not provide access to the “signal blocking” facility. Maybe this is not needed, since the thread support may provide solutions to the problem of consistent access to data structures.
Return all signal handlers to the values they had before any call to
sigaction
was made. The return value is unspecified.
Set a timer to raise a
SIGALRM
signal after the specified number of seconds (an integer). It's advisable to install a signal handler forSIGALRM
beforehand, since the default action is to terminate the process.The return value indicates the time remaining for the previous alarm, if any. The new value replaces the previous alarm. If there was no previous alarm, the return value is zero.
Pause the current process (thread?) until a signal arrives whose action is to either terminate the current process or invoke a handler procedure. The return value is unspecified.
Wait for the given number of seconds (an integer) or until a signal arrives. The return value is zero if the time elapses or the number of seconds remaining otherwise.
Sleep for i microseconds.
usleep
is not available on all platforms. [FIXME: so what happens when it isn't?]
Set the timer specified by which_timer according to the given interval_seconds, interval_microseconds, value_seconds, and value_microseconds values.
Return information about the timer's previous setting.
The timers available are:
ITIMER_REAL
,ITIMER_VIRTUAL
, andITIMER_PROF
.The return value will be a list of two cons pairs representing the current state of the given timer. The first pair is the seconds and microseconds of the timer
it_interval
, and the second pair is the seconds and microseconds of the timerit_value
.
Return information about the timer specified by which_timer.
The timers available are:
ITIMER_REAL
,ITIMER_VIRTUAL
, andITIMER_PROF
.The return value will be a list of two cons pairs representing the current state of the given timer. The first pair is the seconds and microseconds of the timer
it_interval
, and the second pair is the seconds and microseconds of the timerit_value
.