Issue 33332: Expose valid signal set (sigfillset()): add signal.valid_signals() (original) (raw)

Created on 2018-04-22 11:03 by pitrou, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 6581 merged pitrou,2018-04-23 19:43
Messages (7)
msg315606 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2018-04-22 11:03
See : it would be nice to expose a signal module function to get the set of user-actionable signals. Hopefully sigfillset() does that.
msg316165 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2018-05-04 11:01
New changeset 9d3627e311211a1b4abcda29c36fe4afe2c46532 by Antoine Pitrou in branch 'master': bpo-33332: Add signal.valid_signals() (GH-6581) https://github.com/python/cpython/commit/9d3627e311211a1b4abcda29c36fe4afe2c46532
msg316166 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-05-04 11:03
FYI on Fedora 27, I get: >>> signal.NSIG 65 >>> set(range(0, signal.NSIG)) - signal.valid_signals() {0, 33, 32} >>> len(signal.valid_signals()) 62 >>> min(signal.valid_signals()) <Signals.SIGHUP: 1> >>> max(signal.valid_signals()) <Signals.SIGRTMAX: 64> So signals 0, 32 and 33 are invalid, the first valid signal is 1 and the last is 64.
msg316171 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2018-05-04 13:21
On Ubuntu 14.04, I get the same results as Victor.
msg316172 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2018-05-04 13:22
This is expected, see .
msg316173 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-05-04 13:23
+ if (sigemptyset(&mask) | sigfillset(&mask)) { I'm not sure that sigemptyset() is needed. sigfillset() manual page: sigfillset() initializes set to full, including all signals. The function is used to *initialize* a set.
msg316174 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2018-05-04 13:29
Yes, but we're not losing anything by being overly cautious.
History
Date User Action Args
2022-04-11 14:58:59 admin set github: 77513
2018-05-04 13:29:30 pitrou set messages: +
2018-05-04 13:23:43 vstinner set messages: +
2018-05-04 13:22:14 pitrou set messages: +
2018-05-04 13:21:41 cheryl.sabella set nosy: + cheryl.sabellamessages: +
2018-05-04 11:03:38 vstinner set nosy: + vstinnermessages: +
2018-05-04 11:01:34 pitrou set status: open -> closedresolution: fixedstage: patch review -> resolved
2018-05-04 11:01:01 pitrou set messages: +
2018-05-03 12:37:24 vstinner set title: Expose valid signal set (sigfillset()) -> Expose valid signal set (sigfillset()): add signal.valid_signals()
2018-04-23 19:43:50 pitrou set nosy: + njs
2018-04-23 19:43:27 pitrou set keywords: + patchstage: needs patch -> patch reviewpull_requests: + <pull%5Frequest6281>
2018-04-22 11:03:27 pitrou create