Next: posix stat, Previous: posix status, Up: posix [Index]
Interface to the C function raise()
, (libc)raise. Send the selected signal to the calling process. If successful
return zero, else raise an exception.
Interface to the C function kill()
, (libc)kill. Send the selected signal to selected process. If
successful return zero, else raise an exception.
Interface to the C function pause()
, (libc)pause. Suspend the process until a signal is received; return the void
object.
The block/unblock (BUB) API is a simplified interface to detect the arrival of interprocess signals; if it does not suit the application’s model, we should just ignore it. It is impossible to use the BUB API along with other interprocess signal APIs. Here is a meaningless usage example:
(import (vicare) (prefix (vicare posix) px.) (vicare platform constants)) (px.signal-bub-init) (px.raise SIGUSR1) (px.signal-bub-acquire) (px.signal-bub-delivered? SIGUSR1) ⇒ #t (px.signal-bub-delivered? SIGUSR2) ⇒ #f (signal-bub-final)
Block all the signals and initialise the BUB interface.
Set all the signal handlers to SIG_IGN
, then unblock all the
signals and finalise the BUB interface.
Unblock all the signals, then block them again. This should allow all the pending signals to be delivered to the process.
Return #t
if the signal signum has been delivered at least
once before the last call to signal-bub-acquire
.
Calling this function with signum clears the internal flag for
this signal, so calling it again without acquiring new signals always
returns #f
.
This function interferes with signal-bub-all-delivered
.
Return a list of fixnums representing the signals delivered before the
last call to signal-bub-acquire
. Calling this function clears
the internal flags for all the signals, so calling it again without
acquiring new signals always returns the empty list.
This function interferes with signal-bub-delivered?
.
Scheme representation of the C language type siginfo_t
which is a
structure typedef. It has the following fields (some of them are not
present on all the architectures):
si_signo
Signal number.
si_errno
An errno
value.
si_code
Signal code.
si_trapno
Trap number that caused hardware–generated signal (unused on most architectures).
si_pid
Sending process ID.
si_uid
Real user ID of sending process.
si_status
Exit value or signal.
si_utime
User time consumed.
si_stime
System time consumed.
si_value.sival_int
si_value.sival_ptr
Signal value. The C language type sigval_t
is a union with
fields int sival_int
and void *sival_ptr
.
si_int
POSIX.1b signal.
si_ptr
POSIX.1b signal.
si_overrun
Timer overrun count; POSIX.1b timers.
si_timerid
Timer ID; POSIX.1b timers.
si_addr
Memory location which caused fault.
si_band
Band event.
si_fd
File descriptor.
si_addr_lsb
Least significant bit of address.
NOTE On GNU+Linux: for details on the
struct siginfo_t
type see the manual pagesigaction(2)
.
Build and return a new instance of struct-siginfo_t
. If no
arguments are given: all the fields are initialised to #f
.
Return #t
if obj is an instance of struct-siginfo_t
.
Accessors for the fields of struct-siginfo_t
.
Mutators for the fields of struct-siginfo_t
.
Interface to the C function sigwaitinfo()
, see the manual page
sigwaitinfo(2)
. Synchronously wait for a queued signal; if
successful return two values: a fixnum representing a signal number and
siginfo; else raise an exception.
signo must be a fixnum representing an interprocess signal code.
The optional siginfo must be an instance of
struct-siginfo_t
, which is filled with the informations attached
to the signal; when not given a new instance is allocated internally.
#!r6rs (import (vicare) (prefix (vicare posix) px.) (vicare platform constants) (vicare language-extensions syntaxes)) (px.signal-bub-init) (px.raise SIGALRM) (let-values (((signo info) (px.sigwaitinfo SIGALRM))) signo ⇒ SIGALRM (px.struct-siginfo_t-si_signo info)) ⇒ SIGALRM
Interface to the C function sigtimedwait()
, see the manual page
sigtimedwait(2)
. Synchronously wait for a queued signal, with a
timeout; if successful return two values: a fixnum representing a signal
number and siginfo; else raise an exception.
signo must be a fixnum representing an interprocess signal code.
siginfo must be an instance of struct-siginfo_t
, which is
filled with the informations attached to the signal; when not given a
new instance is allocated internally.
timeout must be an instance of struct-timespec
: it
represents the maximum interval of time to wait for the signal;
posix time timespec for details.
#!r6rs (import (vicare) (prefix (vicare posix) px.) (vicare platform constants) (vicare language-extensions syntaxes)) (px.signal-bub-init) (px.raise SIGUSR1) (let-values (((signo info) (px.sigtimedwait SIGUSR1 (px.make-struct-timespec 1 0)))) signo ⇒ SIGUSR1 (px.struct-siginfo_t-si_signo info)) ⇒ SIGUSR1
Next: posix stat, Previous: posix status, Up: posix [Index]