sigaction#

Install or inspect a signal handler for signal $sig.

Σύνοψη#

use POSIX qw(sigaction SIGINT);
my $action = POSIX::SigAction->new("IGNORE");
my $old = POSIX::SigAction->new;
sigaction(SIGINT, $action, $old);

Τι επιστρέφεται#

"0 but true" on success, undef on failure. When $oldaction is supplied, it is populated with the previous HANDLER, MASK, FLAGS, and SAFE fields.

Οριακές περιπτώσεις#

  • Negative $sig croaks with Negative signals are not allowed.

  • An action hash without a HANDLER key croaks with Can't supply an action without a HANDLER.

Διαφορές από το upstream#

  • Coderef handlers are not yet wired to the perl5 callback bridge, so passing one silently falls through and leaves the current disposition in place. Upstream would invoke the Perl code on signal delivery.

Δείτε επίσης#

  • sigprocmask - change the blocked-signal mask.

  • POSIX::SigSet - build the MASK field of an action.