Mark Overmeer > POSIX-1003-0.02 > POSIX::1003::SigAction

Download:
POSIX-1003-0.02.tar.gz

Annotate this POD

CPAN RT

Open  2
View/Report Bugs
Source  

NAME ^

POSIX::1003::SigAction - represent a struct sigaction

SYNOPSIS ^

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

  $sigset    = $sigaction->mask;
  $sigaction->flags(SA_RESTART);
  $sigaction->safe(1);

DESCRIPTION ^

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

METHODS ^

Constructors

POSIX::SigAction->new(HANDLER, [SIGSET, [FLAGS]])

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.

Other

$obj->flags()

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

$obj->handler()
$obj->mask()
$obj->safe()

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::1003::SigAction object:

   $sigaction->safe(1);

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 subroutine sigaction:

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

SEE ALSO ^

This module is part of POSIX-1003 distribution version 0.02, built on December 19, 2011. Website: http://perl.overmeer.net. The code is based on POSIX, which is released with Perl itself.

COPYRIGHTS ^

Copyrights of the perl code and the related documentation by 2011 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

syntax highlighting: