++ed by:

2 PAUSE users
2 non-PAUSE users.

Mark Overmeer
and 1 contributors


POSIX::SigAction - represent a struct sigaction


  $sigset    = POSIX::SigSet->new(SIGINT, SIGQUIT);
  $sigaction = POSIX::SigAction
     ->new(\&handler, $sigset, SA_NOCLDSTOP);

  $sigset    = $sigaction->mask;


The POSIX::SigAction object corresponds to the C struct sigaction, defined by signal.h.

This module is a bit tricky: POSIX.pm contains the same code for the POSIX::SigAction namespace. However, we do not need POSIX.pm but only the POSIX.xs component which has the namespace hard-coded.




The first parameter is the handler, a code reference. The second parameter is a POSIX::SigSet object, it defaults to the empty set. The third parameter contains the sa_flags, it defaults to 0.

This object will be destroyed automatically when it is no longer needed.



Accessor functions to get/set the values of a SigAction object.


Accessor function for the "safe signals" flag of a SigAction object; see perlipc for general information on safe (a.k.a. "deferred") signals. If you wish to handle a signal safely, use this accessor to set the "safe" flag in the POSIX::SigAction object:


You may also examine the "safe" flag on the output action object which is filled in when given as the third parameter to POSIX::1003::Signals::sigaction():

  sigaction(SIGINT, $new_action, $old_action);
  if ($old_action->safe) {
     # previous SIGINT handler used safe signals


This module is part of POSIX-1003 distribution version 0.98, built on December 03, 2013. Website: http://perl.overmeer.net. The code is based on POSIX, which is released with Perl itself. See also POSIX::Util for additional functionality.


Copyrights 2011-2013 on the perl code and the related documentation by [Mark Overmeer]. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html