💾 Archived View for tris.fyi › pydoc › signal captured on 2023-04-26 at 13:31:54. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-01-29)

-=-=-=-=-=-=-

Back to module index

Go to module by name

signal

This module has no docstring.

Classes

Handlers

An enumeration.
SIG_DFL = <Handlers.SIG_DFL: 0>
SIG_IGN = <Handlers.SIG_IGN: 1>

itimer_error

with_traceback(...)

  Exception.with_traceback(tb) --
      set self.__traceback__ to tb and return self.
args = <attribute 'args' of 'BaseException' objects>
characters_written = <attribute 'characters_written' of 'OSError' objects>
errno = <member 'errno' of 'OSError' objects>
  POSIX exception code
filename = <member 'filename' of 'OSError' objects>
  exception filename
filename2 = <member 'filename2' of 'OSError' objects>
  second exception filename
strerror = <member 'strerror' of 'OSError' objects>
  exception strerror

Sigmasks

An enumeration.
SIG_BLOCK = <Sigmasks.SIG_BLOCK: 0>
SIG_SETMASK = <Sigmasks.SIG_SETMASK: 2>
SIG_UNBLOCK = <Sigmasks.SIG_UNBLOCK: 1>

Signals

An enumeration.
SIGABRT = <Signals.SIGABRT: 6>
SIGALRM = <Signals.SIGALRM: 14>
SIGBUS = <Signals.SIGBUS: 7>
SIGCHLD = <Signals.SIGCHLD: 17>
SIGCONT = <Signals.SIGCONT: 18>
SIGFPE = <Signals.SIGFPE: 8>
SIGHUP = <Signals.SIGHUP: 1>
SIGILL = <Signals.SIGILL: 4>
SIGINT = <Signals.SIGINT: 2>
SIGIO = <Signals.SIGIO: 29>
SIGKILL = <Signals.SIGKILL: 9>
SIGPIPE = <Signals.SIGPIPE: 13>
SIGPROF = <Signals.SIGPROF: 27>
SIGPWR = <Signals.SIGPWR: 30>
SIGQUIT = <Signals.SIGQUIT: 3>
SIGRTMAX = <Signals.SIGRTMAX: 64>
SIGRTMIN = <Signals.SIGRTMIN: 34>
SIGSEGV = <Signals.SIGSEGV: 11>
SIGSTOP = <Signals.SIGSTOP: 19>
SIGSYS = <Signals.SIGSYS: 31>
SIGTERM = <Signals.SIGTERM: 15>
SIGTRAP = <Signals.SIGTRAP: 5>
SIGTSTP = <Signals.SIGTSTP: 20>
SIGTTIN = <Signals.SIGTTIN: 21>
SIGTTOU = <Signals.SIGTTOU: 22>
SIGURG = <Signals.SIGURG: 23>
SIGUSR1 = <Signals.SIGUSR1: 10>
SIGUSR2 = <Signals.SIGUSR2: 12>
SIGVTALRM = <Signals.SIGVTALRM: 26>
SIGWINCH = <Signals.SIGWINCH: 28>
SIGXCPU = <Signals.SIGXCPU: 24>
SIGXFSZ = <Signals.SIGXFSZ: 25>

struct_siginfo

struct_siginfo: Result from sigwaitinfo or sigtimedwait.

This object may be accessed either as a tuple of
(si_signo, si_code, si_errno, si_pid, si_uid, si_status, si_band),
or via the attributes si_signo, si_code, and so on.
count(self, value, /)

  Return number of occurrences of value.
index(self, value, start=0, stop=9223372036854775807, /)

  Return first index of value.

  Raises ValueError if the value is not present.
n_fields = 7
n_sequence_fields = 7
n_unnamed_fields = 0
si_band = <member 'si_band' of 'signal.struct_siginfo' objects>
  band event for SIGPOLL
si_code = <member 'si_code' of 'signal.struct_siginfo' objects>
  signal code
si_errno = <member 'si_errno' of 'signal.struct_siginfo' objects>
  errno associated with this signal
si_pid = <member 'si_pid' of 'signal.struct_siginfo' objects>
  sending process ID
si_signo = <member 'si_signo' of 'signal.struct_siginfo' objects>
  signal number
si_status = <member 'si_status' of 'signal.struct_siginfo' objects>
  exit value or signal
si_uid = <member 'si_uid' of 'signal.struct_siginfo' objects>
  real user ID of sending process

Functions

alarm

alarm(seconds, /)

  Arrange for SIGALRM to arrive after the given number of seconds.

default_int_handler

default_int_handler(signalnum, frame, /)

  The default handler for SIGINT installed by Python.

  It raises KeyboardInterrupt.

getitimer

getitimer(which, /)

  Returns current value of given itimer.

getsignal

getsignal(signalnum)

  Return the current action for the given signal.

  The return value can be:
    SIG_IGN -- if the signal is being ignored
    SIG_DFL -- if the default action for the signal is in effect
    None    -- if an unknown handler is in effect
    anything else -- the callable Python object used as a handler

pause

pause()

  Wait until a signal arrives.

pidfd_send_signal

pidfd_send_signal(pidfd, signalnum, siginfo=None, flags=0, /)

  Send a signal to a process referred to by a pid file descriptor.

pthread_kill

pthread_kill(thread_id, signalnum, /)

  Send a signal to a thread.

pthread_sigmask

pthread_sigmask(how, mask)

  Fetch and/or change the signal mask of the calling thread.

raise_signal

raise_signal(signalnum, /)

  Send a signal to the executing process.

set_wakeup_fd

set_wakeup_fd(...)

  set_wakeup_fd(fd, *, warn_on_full_buffer=True) -> fd

  Sets the fd to be written to (with the signal number) when a signal
  comes in.  A library can use this to wakeup select or poll.
  The previous fd or -1 is returned.

  The fd must be non-blocking.

setitimer

setitimer(which, seconds, interval=0.0, /)

  Sets given itimer (one of ITIMER_REAL, ITIMER_VIRTUAL or ITIMER_PROF).

  The timer will fire after value seconds and after that every interval seconds.
  The itimer can be cleared by setting seconds to zero.

  Returns old values as a tuple: (delay, interval).

siginterrupt

siginterrupt(signalnum, flag, /)

  Change system call restart behaviour.

  If flag is False, system calls will be restarted when interrupted by
  signal sig, else system calls will be interrupted.

signal

signal(signalnum, handler)

  Set the action for the given signal.

  The action can be SIG_DFL, SIG_IGN, or a callable Python object.
  The previous action is returned.  See getsignal() for possible return values.

  *** IMPORTANT NOTICE ***
  A signal handler function is called with two arguments:
  the first is the signal number, the second is the interrupted stack frame.

sigpending

sigpending()

  Examine pending signals.

  Returns a set of signal numbers that are pending for delivery to
  the calling thread.

sigtimedwait

sigtimedwait(sigset, timeout, /)

  Like sigwaitinfo(), but with a timeout.

  The timeout is specified in seconds, with floating point numbers allowed.

sigwait

sigwait(sigset)

  Wait for a signal.

  Suspend execution of the calling thread until the delivery of one of the
  signals specified in the signal set sigset.  The function accepts the signal
  and returns the signal number.

sigwaitinfo

sigwaitinfo(sigset, /)

  Wait synchronously until one of the signals in *sigset* is delivered.

  Returns a struct_siginfo containing information about the signal.

strsignal

strsignal(signalnum, /)

  Return the system description of the given signal.

  The return values can be such as "Interrupt", "Segmentation fault", etc.
  Returns None if the signal is not recognized.

valid_signals

valid_signals()

  Return a set of valid signal numbers on this platform.

  The signal numbers returned by this function can be safely passed to
  functions like `pthread_sigmask`.

Other members

ITIMER_PROF = 2
ITIMER_REAL = 0
ITIMER_VIRTUAL = 1
NSIG = 65
SIGABRT = <Signals.SIGABRT: 6>
SIGALRM = <Signals.SIGALRM: 14>
SIGBUS = <Signals.SIGBUS: 7>
SIGCHLD = <Signals.SIGCHLD: 17>
SIGCLD = <Signals.SIGCHLD: 17>
SIGCONT = <Signals.SIGCONT: 18>
SIGFPE = <Signals.SIGFPE: 8>
SIGHUP = <Signals.SIGHUP: 1>
SIGILL = <Signals.SIGILL: 4>
SIGINT = <Signals.SIGINT: 2>
SIGIO = <Signals.SIGIO: 29>
SIGIOT = <Signals.SIGABRT: 6>
SIGKILL = <Signals.SIGKILL: 9>
SIGPIPE = <Signals.SIGPIPE: 13>
SIGPOLL = <Signals.SIGIO: 29>
SIGPROF = <Signals.SIGPROF: 27>
SIGPWR = <Signals.SIGPWR: 30>
SIGQUIT = <Signals.SIGQUIT: 3>
SIGRTMAX = <Signals.SIGRTMAX: 64>
SIGRTMIN = <Signals.SIGRTMIN: 34>
SIGSEGV = <Signals.SIGSEGV: 11>
SIGSTOP = <Signals.SIGSTOP: 19>
SIGSYS = <Signals.SIGSYS: 31>
SIGTERM = <Signals.SIGTERM: 15>
SIGTRAP = <Signals.SIGTRAP: 5>
SIGTSTP = <Signals.SIGTSTP: 20>
SIGTTIN = <Signals.SIGTTIN: 21>
SIGTTOU = <Signals.SIGTTOU: 22>
SIGURG = <Signals.SIGURG: 23>
SIGUSR1 = <Signals.SIGUSR1: 10>
SIGUSR2 = <Signals.SIGUSR2: 12>
SIGVTALRM = <Signals.SIGVTALRM: 26>
SIGWINCH = <Signals.SIGWINCH: 28>
SIGXCPU = <Signals.SIGXCPU: 24>
SIGXFSZ = <Signals.SIGXFSZ: 25>
SIG_BLOCK = <Sigmasks.SIG_BLOCK: 0>
SIG_DFL = <Handlers.SIG_DFL: 0>
SIG_IGN = <Handlers.SIG_IGN: 1>
SIG_SETMASK = <Sigmasks.SIG_SETMASK: 2>
SIG_UNBLOCK = <Sigmasks.SIG_UNBLOCK: 1>