8000 signal: Add basic signal implementation (only IGN & DFL are supported). · micropython/micropython-lib@b35135e · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b35135e

Browse files
author
Paul Sokolovsky
committed
signal: Add basic signal implementation (only IGN & DFL are supported).
1 parent 2441900 commit b35135e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

signal/signal.py

Lines changed: 18 additions & 0 deletions
< 7A66 td data-grid-cell-id="diff-69d312a780854dde3cbb84654f49523fe6f94a61ee780e1ce86a3e6029f6f2bc-empty-6-2" data-line-anchor="diff-69d312a780854dde3cbb84654f49523fe6f94a61ee780e1ce86a3e6029f6f2bcR6" data-selected="false" role="gridcell" style="background-color:var(--diffBlob-additionLine-bgColor, var(--diffBlob-addition-bgColor-line));padding-right:24px" tabindex="-1" valign="top" class="focusable-grid-cell diff-text-cell right-side-diff-cell pt-4 left-side">+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import _libc
2+
3+
4+
SIG_DFL = 0
5+
SIG_IGN = 1
6
7+
SIGINT = 2
8+
SIGPIPE = 13
9+
SIGTERM = 15
10+
11+
libc = _libc.get()
12+
13+
signal_ = libc.func("i", "signal", "ii")
14+
15+
def signal(n, handler):
16+
if isinstance(handler, int):
17+
return signal_(n, handler)
18+
raise NotImplementedError

0 commit comments

Comments
 (0)
0