summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2004-11-25 22:21:23 +0000
committerNicholas Clark <nick@ccl4.org>2004-11-25 22:21:23 +0000
commit72d28a56b69e0c0388ad7a04620e70afe964a96b (patch)
tree581b9c399aafda04d17264bb3bdf8c74f5d52b6d
parente6475991f68d082755ac93f1da5a1c2a398331d7 (diff)
downloadperl-72d28a56b69e0c0388ad7a04620e70afe964a96b.tar.gz
Integrate:
[ 23532] Subject: [perl #3242] [PATCH]No error on assignment to $> From: "Steve Peters via RT" <perlbug-followup@perl.org> Date: 21 Nov 2004 04:38:09 -0000 Message-ID: <rt-3.0.11-3242-100676.6.32723019025057@perl.org> [ 23533] Subject: [patch pod/perlipc] use POSIX; w/o () is a bad idea From: Stas Bekman <stas@stason.org> Date: Wed, 24 Nov 2004 11:25:14 -0500 Message-ID: <41A4B5EA.3020804@stason.org> [ 23534] Subject: RC1 pod fix #anchor From: Stas Bekman <stas@stason.org> Date: Wed, 24 Nov 2004 10:57:21 -0500 Message-ID: <41A4AF61.9080408@stason.org> p4raw-link: @23534 on //depot/perl: 65c3f8ef8ef106f94d162876a0d4f114f689fc42 p4raw-link: @23533 on //depot/perl: e399c6ae35b89e9cc7cbf04b75c6458d318a75d0 p4raw-link: @23532 on //depot/perl: a537debe17982e491ffa12d12441cf74a452acb2 p4raw-id: //depot/maint-5.8/perl@23539 p4raw-integrated: from //depot/perl@23530 'copy in' pod/perlipc.pod (@23496..) 'merge in' pod/perlvar.pod (@22263..) pod/perlrun.pod (@23496..)
-rw-r--r--pod/perlipc.pod13
-rw-r--r--pod/perlrun.pod2
-rw-r--r--pod/perlvar.pod12
3 files changed, 19 insertions, 8 deletions
diff --git a/pod/perlipc.pod b/pod/perlipc.pod
index f94cc5b653..76dcfed734 100644
--- a/pod/perlipc.pod
+++ b/pod/perlipc.pod
@@ -355,11 +355,16 @@ with your timeouts. If you are having problems with such functions,
you can try using the POSIX sigaction() function, which bypasses the
Perl safe signals (note that this means subjecting yourself to
possible memory corruption, as described above). Instead of setting
-C<$SIG{ALRM}> try something like the following:
+C<$SIG{ALRM}>:
- use POSIX;
- sigaction SIGALRM, new POSIX::SigAction sub { die "alarm\n" }
- or die "Error setting SIGALRM handler: $!\n";
+ local $SIG{ALRM} = sub { die "alarm" };
+
+try something like the following:
+
+ use POSIX qw(SIGALRM);
+ POSIX::sigaction(SIGALRM,
+ POSIX::SigAction->new(sub { die "alarm" }))
+ or die "Error setting SIGALRM handler: $!\n";
=item Restartable system calls
diff --git a/pod/perlrun.pod b/pod/perlrun.pod
index c0aaed024a..86e84ca205 100644
--- a/pod/perlrun.pod
+++ b/pod/perlrun.pod
@@ -1205,7 +1205,7 @@ L<perlvms> and in F<README.vms> in the Perl source distribution.
In Perls 5.8.1 and later. If set to C<unsafe> the pre-Perl-5.8.0
signals behaviour (immediate but unsafe) is restored. If set to
C<safe> the safe (or deferred) signals are used.
-See L<perlipc/"Deferred Signals (Safe signals)">.
+See L<perlipc/"Deferred Signals (Safe Signals)">.
=item PERL_UNICODE
diff --git a/pod/perlvar.pod b/pod/perlvar.pod
index b418194220..39f0052121 100644
--- a/pod/perlvar.pod
+++ b/pod/perlvar.pod
@@ -778,7 +778,9 @@ you may use the CPAN module C<Linux::Pid>.
The real uid of this process. (Mnemonic: it's the uid you came I<from>,
if you're running setuid.) You can change both the real uid and
-the effective uid at the same time by using POSIX::setuid().
+the effective uid at the same time by using POSIX::setuid(). Since
+changes to $< require a system call, check $! after a change attempt to
+detect any possible errors.
=item $EFFECTIVE_USER_ID
@@ -792,7 +794,8 @@ The effective uid of this process. Example:
($<,$>) = ($>,$<); # swap real and effective uid
You can change both the effective uid and the real uid at the same
-time by using POSIX::setuid().
+time by using POSIX::setuid(). Changes to $> require a check to $!
+to detect any possible errors after an attempted change.
(Mnemonic: it's the uid you went I<to>, if you're running setuid.)
C<< $< >> and C<< $> >> can be swapped only on machines
@@ -815,7 +818,8 @@ set the real gid. So the value given by C<$(> should I<not> be assigned
back to C<$(> without being forced numeric, such as by adding zero.
You can change both the real gid and the effective gid at the same
-time by using POSIX::setgid().
+time by using POSIX::setgid(). Changes to $( require a check to $!
+to detect any possible errors after an attempted change.
(Mnemonic: parentheses are used to I<group> things. The real gid is the
group you I<left>, if you're running setgid.)
@@ -841,6 +845,8 @@ list, say C< $) = "5 5" >.
You can change both the effective gid and the real gid at the same
time by using POSIX::setgid() (use only a single numeric argument).
+Changes to $) require a check to $! to detect any possible errors
+after an attempted change.
(Mnemonic: parentheses are used to I<group> things. The effective gid
is the group that's I<right> for you, if you're running setgid.)