summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-09-05 15:29:57 -0600
committerKarl Williamson <khw@cpan.org>2020-09-05 15:36:20 -0600
commitea81552be86b620eb7aad870fb2b750cc38ea61d (patch)
tree057319a6ed34ee311e4d643a60388b79dd669717
parent4be3b9cad219d9b9a07e2fa93ffeb7e3daf268a5 (diff)
downloadperl-ea81552be86b620eb7aad870fb2b750cc38ea61d.tar.gz
Document whichsig and kin
-rw-r--r--embed.fnc8
-rw-r--r--mg.c25
2 files changed, 29 insertions, 4 deletions
diff --git a/embed.fnc b/embed.fnc
index 18f80fe73e..4101fdd724 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -2603,10 +2603,10 @@ Apd |bool |dump_c_backtrace|NN PerlIO* fp|int max_depth|int skip
#endif
: FIXME
p |void |watch |NN char** addr
-Am |I32 |whichsig |NN const char* sig
-Ap |I32 |whichsig_sv |NN SV* sigsv
-Ap |I32 |whichsig_pv |NN const char* sig
-Ap |I32 |whichsig_pvn |NN const char* sig|STRLEN len
+Amd |I32 |whichsig |NN const char* sig
+Apd |I32 |whichsig_sv |NN SV* sigsv
+Apd |I32 |whichsig_pv |NN const char* sig
+Apd |I32 |whichsig_pvn |NN const char* sig|STRLEN len
: used to check for NULs in pathnames and other names
AiRdp |bool |is_safe_syscall|NN const char *pv|STRLEN len|NN const char *what|NN const char *op_name
#ifdef PERL_CORE
diff --git a/mg.c b/mg.c
index 3708bd50fe..9b6b4cc895 100644
--- a/mg.c
+++ b/mg.c
@@ -3305,6 +3305,31 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
return 0;
}
+/*
+=for apidoc_section Signals
+=for apidoc whichsig
+=for apidoc_item whichsig_pv
+=for apidoc_item whichsig_pvn
+=for apidoc_item whichsig_sv
+
+These all convert a signal name into its corresponding signal number;
+returning -1 if no corresponding number was found.
+
+They differ only in the source of the signal name:
+
+C<whichsig_pv> takes the name from the C<NUL>-terminated string starting at
+C<sig>.
+
+C<whichsig> is merely a different spelling, a synonym, of C<whichsig_pv>.
+
+C<whichsig_pvn> takes the name from the string starting at C<sig>, with length
+C<len> bytes.
+
+C<whichsig_sv> takes the name from the PV stored in the SV C<sigsv>.
+
+=cut
+*/
+
I32
Perl_whichsig_sv(pTHX_ SV *sigsv)
{