From: Brendan O'Dea Date: Wed, 4 Sep 2002 02:36:10 +0000 (+1000) Subject: Re: [PATCH 5.8.0] add accessors for POSIX::SigAction X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=557c0de77f34a6b3bb86c0e3be82c255a426eb96;p=p5sagit%2Fp5-mst-13.2.git Re: [PATCH 5.8.0] add accessors for POSIX::SigAction From: "Brendan O'Dea" Message-ID: <20020903163610.GA14595@londo.odea.dropbear.id.au> p4raw-id: //depot/perl@17839 --- diff --git a/ext/POSIX/POSIX.pm b/ext/POSIX/POSIX.pm index 05634f0..5a1cbb9 100644 --- a/ext/POSIX/POSIX.pm +++ b/ext/POSIX/POSIX.pm @@ -51,9 +51,12 @@ sub AUTOLOAD { goto &$AUTOLOAD; } -sub POSIX::SigAction::new { - bless {HANDLER => $_[1], MASK => $_[2], FLAGS => $_[3] || 0}, $_[0]; -} +package POSIX::SigAction; + +use AutoLoader 'AUTOLOAD'; +sub new { bless {HANDLER => $_[1], MASK => $_[2], FLAGS => $_[3] || 0}, $_[0] } + +package POSIX; 1; __END__ @@ -948,3 +951,9 @@ for (values %EXPORT_TAGS) { require Exporter; } + +package POSIX::SigAction; + +sub handler { $_[0]->{HANDLER} = $_[1] if @_ > 1; $_[0]->{HANDLER} }; +sub mask { $_[0]->{MASK} = $_[1] if @_ > 1; $_[0]->{MASK} }; +sub flags { $_[0]->{FLAGS} = $_[1] if @_ > 1; $_[0]->{FLAGS} }; diff --git a/ext/POSIX/POSIX.pod b/ext/POSIX/POSIX.pod index 286df40..cea5eca 100644 --- a/ext/POSIX/POSIX.pod +++ b/ext/POSIX/POSIX.pod @@ -1594,6 +1594,21 @@ function. =back +=over 8 + +=item handler + +=item mask + +=item flags + +accessor functions to get/set the values of a SigAction object. + + $sigset = $sigaction->mask; + $sigaction->flags(&POSIX::SA_RESTART); + +=back + =head2 POSIX::SigSet =over 8