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
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