New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Script misses EOF on Solaris #807
Comments
From dehc@dhassler.comp.pge.com#!/usr/local/bin/perl -w # This script runs as expected on AIX, HP/UX, Linux, SunOS 4.1 my($MAX) = 64; open( IN, "$0" ) || die "open $!\n";; # open self as input $SIG{CHLD} = 'IGNORE'; my( $count ) = 0; $| = 1; while ( <IN> ) { chomp; ++$count; # break out counter $chldpid = fork(); # Fork one child per line of input. if ( $chldpid == 0 ) { # Child print "$count chldpid $$: $_\n"; } else { print "==>$count $. forked $chldpid\n"; } # Parent if ( $count > $MAX ) { print "MAX count ($MAX) exceeded\n"; last; } Perl Info
|
From @smpeters
This is an old one, but certainly confirmed. On Linux and OpenBSD, the |
From @AlanBurlisonSteve Peters via RT wrote:
http://www.gossamer-threads.com/lists/perl/porters/183790 -- |
From @smpetersOn Mon, Feb 06, 2006 at 06:20:50PM +0000, Alan Burlison wrote:
Splendid! For posterity, the important note for Solaris users in that As the fork() manpage says: An application should call _exit() rather than exit(3C) if Big rule: Don't use exit() after fork(), use _exit(). |
@smpeters - Status changed from 'open' to 'resolved' |
From @smpeters
I guess perldocs for this would be nice too :). I've added the Change 27108 by stevep@stevep-mccoy on 2006/02/06 19:43:17 Document the limitations of calling exit() (instead of _exit()) from Affected files ... ... //depot/perl/pod/perlfork.pod#11 edit Differences ... ==== //depot/perl/pod/perlfork.pod#11 (text) ==== @@ -100,7 +100,7 @@ =item Open handles to files, directories and network sockets @@ -177,6 +177,13 @@ +On some operating systems, notably Solaris and Unixware, calling C<exit()> The C<open(FOO, "|-")> and C<open(BAR, "-|")> constructs are not yet |
From @nwc10On Mon, Feb 06, 2006 at 11:44:24AM -0800, Steve Peters via RT wrote:
I think I'd prefer it if "On these systems..." were changed to "In the child I believe that it's never incorrect to call _exit(), so we're doing no-one Nicholas Clark |
From @smpetersOn Mon, Feb 06, 2006 at 07:52:05PM +0000, Nicholas Clark wrote:
I'll take a look at Win32 and Cygwin to see how they do following the |
From nick@ing-simmons.netNicholas Clark <nick@ccl4.org> writes:
I agree with that.
|
From @ysthOn Mon, Feb 06, 2006 at 10:40:21PM +0000, Nick Ing-Simmons wrote:
atexit handlers installed by XS modules?
use feature "_exit"; ? |
From @smpetersNick Ing-Simmons wrote:
Unfortunately, it appears that _exit() doesn't work on Win32, or it just Steve Peters |
From @smpeters
I shouldn't try to analyze bugs when sleepy. Actually, the lack of |
From @smpetersOn Tue, Feb 07, 2006 at 04:41:27AM -0800, Steve Peters via RT wrote:
Google works wonderfully with MSDN. There is a function called Steve Peters |
From nick@ing-simmons.netSteve Peters via RT <perlbug-followup@perl.org> writes:
i.e. _exit() works too well and exits the process taking all the |
Migrated from rt.perl.org#1734 (status was 'resolved')
Searchable as RT1734$
The text was updated successfully, but these errors were encountered: