On Fri, Nov 28, 2003 at 11:49:25PM -0800, drieux wrote:
> has anyone else bumped heads with the 5.8.1 perlio layer where
> the old school tie
> 
>       chomp(my $line = <STDIN>);
> 
> now pops out if a sig handler is called on a signal, such as
> SIG_CHLD???

This looks like the new "safe signals" feature (under-documented and
by-no-means-backwards-compatible, but turned on by default) that was
introduced in 5.8.0.  Your code used to work because this:

    $SIG{CHLD} = \&foo;

Called sigaction() with the SA_RESTART flag, so somewhere deep under the
hood of "my $line = <STDIN>", the read() system call would continue if it
got interrupted by a SIGCHLD.

Nowadays, in order to deliver deferred signals promptly, the SA_RESTART
flag isn't being used and so read() will fail when interrupted.  But 
your code should still work, since the perlio layer checks for EINTR and
retries the interrupted syscall manually.

Maybe this is a quirk of the OS X Perl configuration?  Your code works
for me on Linux (5.8.0 and 5.8.1) but not OS X (10.2.6/5.8.0).

-- 
Steve

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to