fault.system

System kernel and Python runtime interfaces.

collections
import

close
function
None

close(fds)

Close the file descriptors produced by the iterable.

retained
function
None

retained(fds)

Preserve the given file descriptors across process image substitutions(exec).

released
function
None

released(fds)

Configure the file descriptors to be released when the process is substituted(exec).

hostname
function
str

hostname()

Retrieve the hostname of the system using gethostname(2).

machine
function
tuple[str, str]

machine()

Retrieve the system name and instruction architecture of the runtime using uname(2).

clockticks
function
int

clockticks()

Retrieve the sysconf value of SC_CLK_TCK.

signalexit
function
None

signalexit(signo)

Configure an atexit call to force the process to exit via a signal.

initialize
function

initialize()

Initialize the after fork callbacks. Called once by process. Do not use directly.

Ports
class

File descriptor vector.

Ports__init__
method

__init__(self, fds)

Event
class

Event data union and scheduling identity.

Eventtype
property
str

A string identifying the type of event.

Eventport
property

A file descriptor identifying the source of events.

Eventcorrelation
property

For I/O, a file descriptor identifying the cited opposition of port. May be -1.

Eventinput
property
int

Position independent access to the file descriptor identifying the receive side.

For io-transmit events, this is the correlation. For io-receive events, this is the port.

Eventoutput
property
int

Position independent access to the file descriptor identifying the transmit side.

For io-transmit events, this is the port. For io-receive events, this is the correlation.

Eventmeta_actuate
classmethod

meta_actuate(Class)

Construct an event that will occur upon the actuation of the Scheduler instance that the operation was dispatched on.

Eventmeta_terminate
classmethod

meta_terminate(Class)

Construct an event that will occur upon the termination of the Scheduler instance that the operation was dispatched on.

Eventnever
classmethod

never(Class, reference)

Construct an event that is known to never occur.

Eventtime
classmethod

time(Class, nanosecond)

Construct an event that will occur after the specified duration occurs.

Eventprocess_exit
classmethod

process_exit(Class, pid)

Construct an event identifier that will occur when process identified by pid exits. If procfd is given on supporting systems, it will be used instead of allocating one or using the pid directly.

Eventprocess_signal
classmethod

process_signal(Class, signo)

Construct an event identifier that will occur when the host process receives the cited signal. If sigfd is given on supporting systems, it will be used instead of allocating one or using the signo directly.

Eventfs_status
classmethod

fs_status(Class, path)

Construct an event identifier that will occur when the status of the file identified by path, or fileno, has changed.

Eventfs_delta
classmethod

fs_delta(Class, path)

Construct an event identifier that will occur when the file identified by path, or fileno, is modified.

Eventfs_void
classmethod

fs_void(Class, path)

Construct an event identifier that will occur when the file identified by path, or fileno, is deleted.

Eventio_transmit
classmethod

io_transmit(Class, port)

Event identifier that occurs when writes are possible on the given port file descriptor.

Eventio_receive
classmethod

io_receive(Class, port)

Event identifier that occurs when reads are possible on the given port file descriptor.

Scheduler
class

Kernel event management and task queue.

Scheduleroperations
method
collections.abc.Sequence[Link]

operations(self)

Construct a snapshot of the dispatched operations.

Schedulervoid
method

void(self)

Immediately destroy the resources held by the scheduler.

Schedulerclosed
property
bool

Whether the scheduler has been closed.

Schedulerclose
method

close(self)

Close the scheduler causing events from the kernel to no longer be retrieved.

Schedulerwait
method
int

wait(self)

Wait for events from the source(operating system) and enqueue their associated tasks for execution.

SchedulerwaitReturns

The count of events that were received from the kernel.

Schedulerinterrupt
method
bool

interrupt(self)

Interrupt a blocking wait call. Nothing if there is no concurrent wait call.

SchedulerinterruptReturns

Whether or not a wait call was interrupted. None if the Scheduler instance is closed.

Schedulerexecute
method
int

execute(self, trap)

Execute enqueued tasks, FIFO. Concurrent calls with wait are prohibited.

SchedulerexecuteParameters

self

Undocumented.

trap

Callable performed when a task raises an exception. trap will be given the task and a normalized exception instance.

If None, exceptions will be discarded.

SchedulerexecuteReturns

The count of tasks that were executed.

Schedulerdispatch
method

dispatch(self, operation)

Execute the operation when its associated event occurs.

SchedulerdispatchParameters

self

Undocumented.

operation

The Link instance to attach to kernel events.

Schedulercancel
method

cancel(self, operation)

Remove the operation from the scheduled set.

Schedulerenqueue
method

enqueue(self, task)

Schedule the task for immediate execution by execute.