summaryrefslogtreecommitdiff
path: root/pod
diff options
context:
space:
mode:
authorSteve Grazzini <grazz@pobox.com>2003-07-16 04:56:21 -0400
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-07-21 19:19:06 +0000
commit9ce5b4ad89f76922e208c6d250bb5f1abd31555c (patch)
tree8e4d4d5ec15de77d8a95935f729d5e4d9a758fd6 /pod
parentea42cebc16314dacc620b3eddbb9295468aa14b9 (diff)
downloadperl-9ce5b4ad89f76922e208c6d250bb5f1abd31555c.tar.gz
[DOCPATCH] %SIG and SA_RESTART
Message-ID: <20030716125620.GA7022@grazzini.net> p4raw-id: //depot/perl@20178
Diffstat (limited to 'pod')
-rw-r--r--pod/perlipc.pod14
-rw-r--r--pod/perlvar.pod21
2 files changed, 18 insertions, 17 deletions
diff --git a/pod/perlipc.pod b/pod/perlipc.pod
index 48fcb7fc63..637030c726 100644
--- a/pod/perlipc.pod
+++ b/pod/perlipc.pod
@@ -352,6 +352,20 @@ C<$SIG{ALRM}> try something like the following:
sigaction SIGALRM, new POSIX::SigAction sub { die "alarm\n" }
or die "Error setting SIGALRM handler: $!\n";
+=item Restartable system calls
+
+On systems that supported it, older versions of Perl used the
+SA_RESTART flag when installing %SIG handlers. This meant that
+restartable system calls would continue rather than returning when
+a signal arrived. In order to deliver deferred signals promptly,
+Perl 5.7.3 and later do I<not> use SA_RESTART. Consequently,
+restartable system calls can fail (with $! set to C<EINTR>) in places
+where they previously would have succeeded.
+
+Note that the default C<:perlio> layer will retry C<read>, C<write>
+and C<close> as described above and that interrupted C<wait> and
+C<waitpid> calls will always be retried.
+
=item Signals as "faults"
Certain signals e.g. SEGV, ILL, BUS are generated as a result of
diff --git a/pod/perlvar.pod b/pod/perlvar.pod
index 4ba6fcff1e..72cb625ae8 100644
--- a/pod/perlvar.pod
+++ b/pod/perlvar.pod
@@ -1336,24 +1336,11 @@ Be sure not to use a bareword as the name of a signal handler,
lest you inadvertently call it.
If your system has the sigaction() function then signal handlers are
-installed using it. This means you get reliable signal handling. If
-your system has the SA_RESTART flag it is used when signals handlers are
-installed. This means that system calls for which restarting is supported
-continue rather than returning when a signal arrives. If you want your
-system calls to be interrupted by signal delivery then do something like
-this:
-
- use POSIX ':signal_h';
-
- my $alarm = 0;
- sigaction SIGALRM, new POSIX::SigAction sub { $alarm = 1 }
- or die "Error setting SIGALRM handler: $!\n";
-
-See L<POSIX>.
+installed using it. This means you get reliable signal handling.
-The delivery policy of signals changed in Perl 5.8.0 from immediate
-(also known as "unsafe") to deferred, also known as "safe signals".
-See L<perlipc> for more information.
+The default delivery policy of signals changed in Perl 5.8.0 from
+immediate (also known as "unsafe") to deferred, also known as
+"safe signals". See L<perlipc> for more information.
Certain internal hooks can be also set using the %SIG hash. The
routine indicated by C<$SIG{__WARN__}> is called when a warning message is