line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyrights 2011-2020 by [Mark Overmeer]. |
2
|
|
|
|
|
|
|
# For other contributors see ChangeLog. |
3
|
|
|
|
|
|
|
# See the manual pages for details on the licensing terms. |
4
|
|
|
|
|
|
|
# Pod stripped from pm file by OODoc 2.02. |
5
|
|
|
|
|
|
|
# This code is part of distribution POSIX-1003. Meta-POD processed with |
6
|
|
|
|
|
|
|
# OODoc into POD and HTML manual-pages. See README.md |
7
|
|
|
|
|
|
|
# Copyright Mark Overmeer. Licensed under the same terms as Perl itself. |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
package POSIX::1003::Signals; |
10
|
4
|
|
|
4
|
|
145773
|
use vars '$VERSION'; |
|
4
|
|
|
|
|
27
|
|
|
4
|
|
|
|
|
263
|
|
11
|
|
|
|
|
|
|
$VERSION = '1.02'; |
12
|
|
|
|
|
|
|
|
13
|
4
|
|
|
4
|
|
28
|
use base 'POSIX::1003::Module'; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
974
|
|
14
|
|
|
|
|
|
|
|
15
|
4
|
|
|
4
|
|
27
|
use warnings; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
117
|
|
16
|
4
|
|
|
4
|
|
88
|
use strict; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
982
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my @functions = qw/ |
19
|
|
|
|
|
|
|
raise sigaction signal sigpending sigprocmask sigsuspend signal |
20
|
|
|
|
|
|
|
signal_names strsignal |
21
|
|
|
|
|
|
|
/; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
my (@handlers, @signals, @actions); |
24
|
|
|
|
|
|
|
my @constants; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
our %EXPORT_TAGS = |
27
|
|
|
|
|
|
|
( signals => \@signals |
28
|
|
|
|
|
|
|
, actions => \@actions |
29
|
|
|
|
|
|
|
, handlers => \@handlers |
30
|
|
|
|
|
|
|
, constants => \@constants |
31
|
|
|
|
|
|
|
, functions => \@functions |
32
|
|
|
|
|
|
|
, tables => [ '%signals' ] |
33
|
|
|
|
|
|
|
); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
our @IN_CORE = qw/kill/; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
my $signals; |
38
|
|
|
|
|
|
|
our %signals; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
BEGIN { |
41
|
4
|
|
|
4
|
|
178
|
$signals = signals_table; |
42
|
|
|
|
|
|
|
|
43
|
4
|
|
|
|
|
82
|
push @constants, keys %$signals; |
44
|
4
|
|
|
|
|
79
|
push @handlers, grep /^SIG_/, keys %$signals; |
45
|
4
|
|
|
|
|
173
|
push @signals, grep !/^SA_|^SIG_/, keys %$signals; |
46
|
4
|
|
|
|
|
61
|
push @actions, grep /^SA_/, keys %$signals; |
47
|
|
|
|
|
|
|
|
48
|
4
|
|
|
|
|
33
|
tie %signals, 'POSIX::1003::ReadOnlyTable', $signals; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
# Perl does not support pthreads, so: |
53
|
0
|
|
|
0
|
1
|
0
|
sub raise($) { CORE::kill $_[0], $$ } |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
24
|
|
|
24
|
1
|
4978
|
sub sigaction($$;$) {goto &POSIX::sigaction } |
57
|
0
|
|
|
0
|
1
|
0
|
sub sigpending($) {goto &POSIX::sigpending } |
58
|
0
|
|
|
0
|
1
|
0
|
sub sigprocmask($$;$) {goto &POSIX::sigprocmask } |
59
|
0
|
|
|
0
|
1
|
0
|
sub sigsuspend($) {goto &POSIX::sigsuspend } |
60
|
0
|
|
|
0
|
1
|
0
|
sub signal($$) { $SIG{$_[0]} = $_[1] } |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
1
|
50
|
|
1
|
1
|
106
|
sub strsignal($) { _strsignal($_[0]) || "Unknown signal $_[0]" } |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
#-------------------------- |
66
|
|
|
|
|
|
|
|
67
|
0
|
|
|
0
|
1
|
0
|
sub signal_names() { @signals } |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
70
|
0
|
|
|
0
|
1
|
0
|
sub sigaction_names() { @actions } |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
#-------------------------- |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub exampleValue($) |
76
|
0
|
|
|
0
|
1
|
0
|
{ my ($class, $name) = @_; |
77
|
0
|
|
|
|
|
0
|
my $val = $signals->{$name}; |
78
|
0
|
0
|
|
|
|
0
|
defined $val ? $val : 'undef'; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub _create_constant($) |
83
|
87
|
|
|
87
|
|
125
|
{ my ($class, $name) = @_; |
84
|
87
|
|
|
|
|
125
|
my $val = $signals->{$name}; |
85
|
87
|
|
|
0
|
|
489
|
sub() {$val}; |
|
0
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
1; |