{
    "content": [
        {
            "type": "text",
            "text": "# _signal (pydoc)\n\n## NAME\n\nsignal - This module provides mechanisms to use signal handlers in Python.\n\n## DESCRIPTION\n\nFunctions:\n\n## Sections\n\n- **NAME**\n- **DESCRIPTION** (7 subsections)\n- **CLASSES** (1 subsections)\n- **FUNCTIONS** (19 subsections)\n- **DATA**\n- **FILE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "_signal",
        "section": "",
        "mode": "pydoc",
        "summary": "signal - This module provides mechanisms to use signal handlers in Python.",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 2,
                "subsections": [
                    {
                        "name": "alarm",
                        "lines": 1
                    },
                    {
                        "name": "setitimer",
                        "lines": 1
                    },
                    {
                        "name": "getitimer",
                        "lines": 1
                    },
                    {
                        "name": "signal",
                        "lines": 1
                    },
                    {
                        "name": "getsignal",
                        "lines": 1
                    },
                    {
                        "name": "pause",
                        "lines": 1
                    },
                    {
                        "name": "default_int_handler",
                        "lines": 23
                    }
                ]
            },
            {
                "name": "CLASSES",
                "lines": 95,
                "subsections": [
                    {
                        "name": "class struct_siginfo",
                        "lines": 126
                    }
                ]
            },
            {
                "name": "FUNCTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "alarm",
                        "lines": 2
                    },
                    {
                        "name": "default_int_handler",
                        "lines": 4
                    },
                    {
                        "name": "getitimer",
                        "lines": 2
                    },
                    {
                        "name": "getsignal",
                        "lines": 8
                    },
                    {
                        "name": "pause",
                        "lines": 2
                    },
                    {
                        "name": "pidfd_send_signal",
                        "lines": 2
                    },
                    {
                        "name": "pthread_kill",
                        "lines": 2
                    },
                    {
                        "name": "pthread_sigmask",
                        "lines": 2
                    },
                    {
                        "name": "raise_signal",
                        "lines": 2
                    },
                    {
                        "name": "set_wakeup_fd",
                        "lines": 8
                    },
                    {
                        "name": "setitimer",
                        "lines": 7
                    },
                    {
                        "name": "siginterrupt",
                        "lines": 5
                    },
                    {
                        "name": "signal",
                        "lines": 9
                    },
                    {
                        "name": "sigpending",
                        "lines": 5
                    },
                    {
                        "name": "sigtimedwait",
                        "lines": 4
                    },
                    {
                        "name": "sigwait",
                        "lines": 6
                    },
                    {
                        "name": "sigwaitinfo",
                        "lines": 4
                    },
                    {
                        "name": "strsignal",
                        "lines": 6
                    },
                    {
                        "name": "valid_signals",
                        "lines": 5
                    }
                ]
            },
            {
                "name": "DATA",
                "lines": 46,
                "subsections": []
            },
            {
                "name": "FILE",
                "lines": 3,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "signal - This module provides mechanisms to use signal handlers in Python.\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Functions:\n",
                "subsections": [
                    {
                        "name": "alarm",
                        "content": ""
                    },
                    {
                        "name": "setitimer",
                        "content": "float time and the timer may restart then [Unix only]"
                    },
                    {
                        "name": "getitimer",
                        "content": ""
                    },
                    {
                        "name": "signal",
                        "content": ""
                    },
                    {
                        "name": "getsignal",
                        "content": ""
                    },
                    {
                        "name": "pause",
                        "content": ""
                    },
                    {
                        "name": "default_int_handler",
                        "content": "signal constants:\nSIGDFL -- used to refer to the system default handler\nSIGIGN -- used to ignore the signal\nNSIG -- number of defined signals\nSIGINT, SIGTERM, etc. -- signal numbers\n\nitimer constants:\nITIMERREAL -- decrements in real time, and delivers SIGALRM upon\nexpiration\nITIMERVIRTUAL -- decrements only when the process is executing,\nand delivers SIGVTALRM upon expiration\nITIMERPROF -- decrements both when the process is executing and\nwhen the system is executing on behalf of the process.\nCoupled with ITIMERVIRTUAL, this timer is usually\nused to profile the time spent by the application\nin user and kernel space. SIGPROF is delivered upon\nexpiration.\n\n\n* IMPORTANT NOTICE *\nA signal handler function is called with two arguments:\nthe first is the signal number, the second is the interrupted stack frame.\n"
                    }
                ]
            },
            "CLASSES": {
                "content": "builtins.OSError(builtins.Exception)\nsignal.itimererror\nbuiltins.tuple(builtins.object)\nsignal.structsiginfo\n\nItimerError = class itimererror(builtins.OSError)\n|  Method resolution order:\n|      itimererror\n|      builtins.OSError\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors defined here:\n|\n|  weakref\n|      list of weak references to the object\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.OSError:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.OSError:\n|\n|  new(*args, kwargs) class method of builtins.OSError\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.OSError:\n|\n|  characterswritten\n|\n|  errno\n|      POSIX exception code\n|\n|  filename\n|      exception filename\n|\n|  filename2\n|      second exception filename\n|\n|  strerror\n|      exception strerror\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  addnote(...)\n|      Exception.addnote(note) --\n|      add a note to the exception\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n",
                "subsections": [
                    {
                        "name": "class struct_siginfo",
                        "content": "|  structsiginfo(iterable=(), /)\n|\n|  structsiginfo: Result from sigwaitinfo or sigtimedwait.\n|\n|  This object may be accessed either as a tuple of\n|  (sisigno, sicode, sierrno, sipid, siuid, sistatus, siband),\n|  or via the attributes sisigno, sicode, and so on.\n|\n|  Method resolution order:\n|      structsiginfo\n|      builtins.tuple\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  ----------------------------------------------------------------------\n|  Static methods defined here:\n|\n|  new(*args, kwargs)\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  siband\n|      band event for SIGPOLL\n|\n|  sicode\n|      signal code\n|\n|  sierrno\n|      errno associated with this signal\n|\n|  sipid\n|      sending process ID\n|\n|  sisigno\n|      signal number\n|\n|  sistatus\n|      exit value or signal\n|\n|  siuid\n|      real user ID of sending process\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes defined here:\n|\n|  matchargs = ('sisigno', 'sicode', 'sierrno', 'sipid', 'siuid...\n|\n|  nfields = 7\n|\n|  nsequencefields = 7\n|\n|  nunnamedfields = 0\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.tuple:\n|\n|  add(self, value, /)\n|      Return self+value.\n|\n|  contains(self, key, /)\n|      Return bool(key in self).\n|\n|  eq(self, value, /)\n|      Return self==value.\n|\n|  ge(self, value, /)\n|      Return self>=value.\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  getitem(self, key, /)\n|      Return self[key].\n|\n|  getnewargs(self, /)\n|\n|  gt(self, value, /)\n|      Return self>value.\n|\n|  hash(self, /)\n|      Return hash(self).\n|\n|  iter(self, /)\n|      Implement iter(self).\n|\n|  le(self, value, /)\n|      Return self<=value.\n|\n|  len(self, /)\n|      Return len(self).\n|\n|  lt(self, value, /)\n|      Return self<value.\n|\n|  mul(self, value, /)\n|      Return self*value.\n|\n|  ne(self, value, /)\n|      Return self!=value.\n|\n|  rmul(self, value, /)\n|      Return value*self.\n|\n|  count(self, value, /)\n|      Return number of occurrences of value.\n|\n|  index(self, value, start=0, stop=9223372036854775807, /)\n|      Return first index of value.\n|\n|      Raises ValueError if the value is not present.\n|\n|  ----------------------------------------------------------------------\n|  Class methods inherited from builtins.tuple:\n|\n|  classgetitem(...)\n|      See PEP 585\n"
                    }
                ]
            },
            "FUNCTIONS": {
                "content": "",
                "subsections": [
                    {
                        "name": "alarm",
                        "content": "Arrange for SIGALRM to arrive after the given number of seconds.\n"
                    },
                    {
                        "name": "default_int_handler",
                        "content": "The default handler for SIGINT installed by Python.\n\nIt raises KeyboardInterrupt.\n"
                    },
                    {
                        "name": "getitimer",
                        "content": "Returns current value of given itimer.\n"
                    },
                    {
                        "name": "getsignal",
                        "content": "Return the current action for the given signal.\n\nThe return value can be:\nSIGIGN -- if the signal is being ignored\nSIGDFL -- if the default action for the signal is in effect\nNone    -- if an unknown handler is in effect\nanything else -- the callable Python object used as a handler\n"
                    },
                    {
                        "name": "pause",
                        "content": "Wait until a signal arrives.\n"
                    },
                    {
                        "name": "pidfd_send_signal",
                        "content": "Send a signal to a process referred to by a pid file descriptor.\n"
                    },
                    {
                        "name": "pthread_kill",
                        "content": "Send a signal to a thread.\n"
                    },
                    {
                        "name": "pthread_sigmask",
                        "content": "Fetch and/or change the signal mask of the calling thread.\n"
                    },
                    {
                        "name": "raise_signal",
                        "content": "Send a signal to the executing process.\n"
                    },
                    {
                        "name": "set_wakeup_fd",
                        "content": "setwakeupfd(fd, *, warnonfullbuffer=True) -> fd\n\nSets the fd to be written to (with the signal number) when a signal\ncomes in.  A library can use this to wakeup select or poll.\nThe previous fd or -1 is returned.\n\nThe fd must be non-blocking.\n"
                    },
                    {
                        "name": "setitimer",
                        "content": "Sets given itimer (one of ITIMERREAL, ITIMERVIRTUAL or ITIMERPROF).\n\nThe timer will fire after value seconds and after that every interval seconds.\nThe itimer can be cleared by setting seconds to zero.\n\nReturns old values as a tuple: (delay, interval).\n"
                    },
                    {
                        "name": "siginterrupt",
                        "content": "Change system call restart behaviour.\n\nIf flag is False, system calls will be restarted when interrupted by\nsignal sig, else system calls will be interrupted.\n"
                    },
                    {
                        "name": "signal",
                        "content": "Set the action for the given signal.\n\nThe action can be SIGDFL, SIGIGN, or a callable Python object.\nThe previous action is returned.  See getsignal() for possible return values.\n\n* IMPORTANT NOTICE *\nA signal handler function is called with two arguments:\nthe first is the signal number, the second is the interrupted stack frame.\n"
                    },
                    {
                        "name": "sigpending",
                        "content": "Examine pending signals.\n\nReturns a set of signal numbers that are pending for delivery to\nthe calling thread.\n"
                    },
                    {
                        "name": "sigtimedwait",
                        "content": "Like sigwaitinfo(), but with a timeout.\n\nThe timeout is specified in seconds, with floating point numbers allowed.\n"
                    },
                    {
                        "name": "sigwait",
                        "content": "Wait for a signal.\n\nSuspend execution of the calling thread until the delivery of one of the\nsignals specified in the signal set sigset.  The function accepts the signal\nand returns the signal number.\n"
                    },
                    {
                        "name": "sigwaitinfo",
                        "content": "Wait synchronously until one of the signals in *sigset* is delivered.\n\nReturns a structsiginfo containing information about the signal.\n"
                    },
                    {
                        "name": "strsignal",
                        "content": "Return the system description of the given signal.\n\nReturns the description of signal *signalnum*, such as \"Interrupt\"\nfor :const:`SIGINT`. Returns :const:`None` if *signalnum* has no\ndescription. Raises :exc:`ValueError` if *signalnum* is invalid.\n"
                    },
                    {
                        "name": "valid_signals",
                        "content": "Return a set of valid signal numbers on this platform.\n\nThe signal numbers returned by this function can be safely passed to\nfunctions like `pthreadsigmask`.\n"
                    }
                ]
            },
            "DATA": {
                "content": "ITIMERPROF = 2\nITIMERREAL = 0\nITIMERVIRTUAL = 1\nNSIG = 65\nSIGABRT = 6\nSIGALRM = 14\nSIGBUS = 7\nSIGCHLD = 17\nSIGCLD = 17\nSIGCONT = 18\nSIGFPE = 8\nSIGHUP = 1\nSIGILL = 4\nSIGINT = 2\nSIGIO = 29\nSIGIOT = 6\nSIGKILL = 9\nSIGPIPE = 13\nSIGPOLL = 29\nSIGPROF = 27\nSIGPWR = 30\nSIGQUIT = 3\nSIGRTMAX = 64\nSIGRTMIN = 34\nSIGSEGV = 11\nSIGSTKFLT = 16\nSIGSTOP = 19\nSIGSYS = 31\nSIGTERM = 15\nSIGTRAP = 5\nSIGTSTP = 20\nSIGTTIN = 21\nSIGTTOU = 22\nSIGURG = 23\nSIGUSR1 = 10\nSIGUSR2 = 12\nSIGVTALRM = 26\nSIGWINCH = 28\nSIGXCPU = 24\nSIGXFSZ = 25\nSIGBLOCK = 0\nSIGDFL = 0\nSIGIGN = 1\nSIGSETMASK = 2\nSIGUNBLOCK = 1\n",
                "subsections": []
            },
            "FILE": {
                "content": "(built-in)\n\n",
                "subsections": []
            }
        }
    }
}