Skip to content

Commit 5e42f33

Browse files
committed
simple send signal example using nativecall
1 parent 20adca9 commit 5e42f33

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
use v6;
2+
3+
=begin pod
4+
5+
=TITLE send a signal
6+
7+
You want to send a signal to a process on a UNIX-like OS
8+
9+
=AUTHOR stmuk
10+
11+
=end pod
12+
13+
use NativeCall;
14+
15+
sub kill(Int,Int) returns Int is native { ... }
16+
17+
signal(SIGHUP).tap( {say "caught HUP"});
18+
19+
kill($*PID, Signal::SIGHUP);
20+
21+
sleep 2;

0 commit comments

Comments
 (0)