summaryrefslogtreecommitdiffstats
path: root/Modules/signalmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-34412: Make signal.strsignal() work on HP-UX (GH-8786)Michael Osipov2018-08-231-2/+20
| | | | | | Introduce a configure check for strsignal(3) which defines HAVE_STRSIGNAL for signalmodule.c. Add some common signals on HP-UX. This change applies for Windows and HP-UX.
* bpo-30654: Do not reset SIGINT handler to SIG_DFL in finisignal (GH-7146)pkerling2018-06-011-12/+2
|
* bpo-33441: Make the sigset_t converter available in other modules. (GH-6720)Serhiy Storchaka2018-05-081-95/+25
| | | | | | | | | * Expose the sigset_t converter via private API _Py_Sigset_Converter(). * Use Argument Clinic for parsing sigset_t in signalmodule.c. * Raise ValueError instead OverflowError for integers out of the C long range. Based on patch by Pablo Galindo Salgado.
* bpo-33332: Add signal.valid_signals() (GH-6581)Antoine Pitrou2018-05-041-5/+59
|
* bpo-33329: Fix multiprocessing regression on newer glibcs (GH-6575)Antoine Pitrou2018-04-231-6/+8
| | | | | | | Starting with glibc 2.27.9000-xxx, sigaddset() can return EINVAL for some reserved signal numbers between 1 and NSIG. The `range(1, NSIG)` idiom is commonly used to select all signals for blocking with `pthread_sigmask`. So we ignore the sigaddset() return value until we expose sigfillset() to provide a better idiom.
* signal: add strsignal() (#6017)Antoine Pietri2018-03-121-0/+61
| | | Co-authored-by: Vajrasky Kok <sky.kok@speaklikeaking.com>
* bpo-30050: Allow disabling full buffer warnings in signal.set_wakeup_fd (#4792)Nathaniel J. Smith2017-12-181-53/+51
|
* bpo-30057: Fix potential missed signal in signal.signal(). (#4258)Antoine Pitrou2017-11-031-1/+4
| | | Bug report and patch by Jeroen Demeyer.
* bpo-30807: signal.setitimer() now uses _PyTime API (GH-3865)Victor Stinner2017-10-131-15/+25
| | | | | | The _PyTime API handles detects overflow and is well tested. Document that the signal will only be sent once if internal is equal to zero.
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-071-22/+2
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* bpo-30808: Use _Py_atomic API for concurrency-sensitive signal state (#2417)Antoine Pitrou2017-07-171-18/+20
| | | | | | | | | | | | | | * Improve signal delivery Avoid using Py_AddPendingCall from signal handler, to avoid calling signal-unsafe functions. * Remove unused function * Improve comments * Use _Py_atomic API for concurrency-sensitive signal state * Add blurb
* bpo-30807: signal.setitimer() may disable the timer by mistake (#2493)Antoine Pitrou2017-06-301-0/+4
| | | | | | * bpo-30807: signal.setitimer() may disable the timer by mistake * Add NEWS blurb
* bpo-30703: Improve signal delivery (#2415)Antoine Pitrou2017-06-281-16/+14
| | | | | | | | | | | | | | | | | | | | * Improve signal delivery Avoid using Py_AddPendingCall from signal handler, to avoid calling signal-unsafe functions. * Remove unused function * Improve comments * Add stress test * Adapt for --without-threads * Add second stress test * Add NEWS blurb * Address comments @haypo
* bpo-16500: Allow registering at-fork handlers (#1715)Antoine Pitrou2017-05-271-7/+1
| | | | | | | | | | | | * bpo-16500: Allow registering at-fork handlers * Address Serhiy's comments * Add doc for new C API * Add doc for new Python-facing function * Add NEWS entry + doc nit
* bpo-30038: fix race condition in signal delivery + wakeup fd (#1082)Nathaniel J. Smith2017-05-161-7/+26
| | | | | | | | | | | | | | | | | | | Before, it was possible to get the following sequence of events (especially on Windows, where the C-level signal handler for SIGINT is run in a separate thread): - SIGINT arrives - trip_signal is called - trip_signal writes to the wakeup fd - the main thread wakes up from select()-or-equivalent - the main thread checks for pending signals, but doesn't see any - the main thread drains the wakeup fd - the main thread goes back to sleep - trip_signal sets is_tripped=1 and calls Py_AddPendingCall to notify the main thread the it should run the Python-level signal handler - the main thread doesn't notice because it's asleep This has been causing repeated failures in the Trio test suite: https://github.com/python-trio/trio/issues/119
* bpo-30022: Get rid of using EnvironmentError and IOError (except test… (#1051)Serhiy Storchaka2017-04-161-1/+1
|
* bpo-6532: Make the thread id an unsigned integer. (#781)Serhiy Storchaka2017-03-231-4/+5
| | | | | | | | | | | * bpo-6532: Make the thread id an unsigned integer. From C API side the type of results of PyThread_start_new_thread() and PyThread_get_thread_ident(), the id parameter of PyThreadState_SetAsyncExc(), and the thread_id field of PyThreadState changed from "long" to "unsigned long". * Restore a check in thread_get_ident().
* Issue #21085: add configure check for siginfo_t.si_bandZachary Ware2016-10-011-0/+4
| | | | | | | Patch by Masayuki Yamamoto, reviewed and rebased by Erik Bray. This is a first step on the long road toward resupporting Cygwin, which does not provide siginfo_t.si_band.
* Issue #28139: Merge indentation fixes from 3.5 into 3.6Martin Panter2016-09-171-7/+7
|\
| * Issue #28139: Fix messed up indentationMartin Panter2016-09-171-7/+7
| | | | | | | | | | Also update the classmethod and staticmethod doc strings and comments to match the RST documentation.
* | Use PyModule_AddIntMacro() in signal moduleChristian Heimes2016-09-081-129/+86
| | | | | | | | | | | | | | The signal module was using old-style module initialization with potential NULL dereferencing. CID 1295026
* | Issue #23524: Finish removing _PyVerify_fd from sourcesSteve Dower2016-09-081-6/+1
| |
* | replace Py_(u)intptr_t with the c99 standard typesBenjamin Peterson2016-09-061-2/+2
|/
* Issue #27332: Fixed the type of the first argument of module-level functionsSerhiy Storchaka2016-07-071-26/+26
| | | | generated by Argument Clinic. Patch by Petr Viktorin.
* Issue #26200: Added Py_SETREF and replaced Py_XSETREF with Py_SETREFSerhiy Storchaka2016-04-101-1/+1
| | | | in places where Py_DECREF was used.
* Issue #22570: Renamed Py_SETREF to Py_XSETREF.Serhiy Storchaka2016-04-061-1/+1
|
* Issue #20440: Massive replacing unsafe attribute setting code with specialSerhiy Storchaka2015-12-241-2/+1
| | | | macro Py_SETREF.
* Fixed compilation error in signalmodule.c (issue #20182).Serhiy Storchaka2015-05-161-3/+3
|
* Issue #20182: converted the signal module to use Argument ClinicTal Einat2015-05-161-215/+246
|
* Issue #23836: Use _Py_write_noraise() to retry on EINTR in trip_signal() ofVictor Stinner2015-04-011-3/+4
| | | | signalmodule.c
* PEP 475: on EINTR, retry the function even if the timeout is equals to zeroVictor Stinner2015-03-301-1/+1
| | | | | | | | | Retry: * signal.sigtimedwait() * threading.Lock.acquire() * threading.RLock.acquire() * time.sleep()
* Issue #23752: _Py_fstat() is now responsible to raise the Python exceptionVictor Stinner2015-03-301-7/+3
| | | | Add _Py_fstat_noraise() function when a Python exception is not welcome.
* Issue #22117: Replace usage of _PyTime_ROUND_UP with _PyTime_ROUND_CEILINGVictor Stinner2015-03-301-1/+2
| | | | | All these functions only accept positive timeouts, so this change has no effect in practice.
* Issue #22117: The signal modules uses the new _PyTime_t APIVictor Stinner2015-03-271-14/+13
| | | | | * Add _PyTime_AsTimespec() * Add unit tests for _PyTime_AsTimespec()
* Issue #23715: signal.sigwaitinfo() and signal.sigtimedwait() are now retriedVictor Stinner2015-03-201-26/+47
| | | | | | | | | | when interrupted by a signal not in the *sigset* parameter, if the signal handler does not raise an exception. signal.sigtimedwait() recomputes the timeout with a monotonic clock when it is retried. Remove test_signal.test_sigwaitinfo_interrupted() because sigwaitinfo() doesn't raise InterruptedError anymore if it is interrupted by a signal not in its sigset parameter.
* Issue #23524: Change back to using Windows errors for _Py_fstat instead of ↵Steve Dower2015-03-081-1/+1
| | | | the errno shim.
* Issue #23152: Implement _Py_fstat() to support files larger than 2 GB on ↵Steve Dower2015-02-211-4/+3
| | | | | | Windows. fstat() may fail with EOVERFLOW on files larger than 2 GB because the file size type is an signed 32-bit integer.
* Issue #23450: Fix signal.set_wakeup_fd() on WindowsVictor Stinner2015-02-121-11/+14
| | | | Detect integer overflow on the file descriptor of the socket on 64-bit Python.
* Issue #22869: Split pythonrun into two modulesNick Coghlan2014-11-201-1/+1
| | | | | | | - interpreter startup and shutdown code moved to a new pylifecycle.c module - Py_OptimizeFlag moved into the new module with the other global flags
* Issue #22042: signal.set_wakeup_fd(fd) now raises an exception if the fileVictor Stinner2014-08-271-1/+19
| | | | descriptor is in blocking mode.
* Issue #22018: On Windows, signal.set_wakeup_fd() now also supports sockets.Victor Stinner2014-07-291-18/+165
| | | | A side effect is that Python depends to the WinSock library.
* Backout 42ced0d023cd: oops, i didn't want to push this changeset :-/Victor Stinner2014-07-241-136/+19
|
* tetsVictor Stinner2014-07-241-19/+136
|
* Issue #22018: signal.set_wakeup_fd() now raises an OSError instead of aVictor Stinner2014-07-211-3/+11
| | | | ValueError on fstat() failure.
* merge along w/ fix for issue #2107 (commit c9239171e429)Brett Cannon2014-04-041-3/+3
|\
| * fix #21076: turn signal module constants into enumsGiampaolo Rodola'2014-04-041-2/+2
|/
* Issue #20320: select.select() and select.kqueue.control() now round the timeoutVictor Stinner2014-02-161-1/+2
| | | | | | aways from zero, instead of rounding towards zero. It should make test_asyncio more reliable, especially test_timeout_rounding() test.
* Issue #20437: Fixed 22 potential bugs when deleting objects references.Serhiy Storchaka2014-02-091-6/+3
|\
| * Issue #20437: Fixed 21 potential bugs when deleting objects references.Serhiy Storchaka2014-02-091-6/+3
| |
* | Issue #18774: Remove last bits of GNU PTH thread code, patch by Vajrasky Kok.Christian Heimes2013-08-181-12/+0
| |