Hi,
my($child_fh, $parent_fh) = (new IO::Handle, new
IO::Handle);
socketpair($child_fh, $parent_fh, AF_UNIX,
SOCK_STREAM, PF_UNSPEC)
or die "socketpair failed: $!";
$child_fh->autoflush;
$parent_fh->autoflush;
if (my $pid = fork) {
close $parent_fh;
$fh_sel->add( $child_fh ); # Start out writing to all
children
} else { # Child starts here
die "cannot fork: $!" unless defined $pid;
close $child_fh;
close STDOUT;
close STDIN;
open(STDOUT, ">&$parent_fh") or die "Cant redirect
STDOUT $!\n"; open(STDIN, "<&$parent_fh") or die
"Cant redirect STDIN $!\n";
STDOUT->autoflush;
close $parent_fh;
my $cmd = "./executable";
my $rv = exec "$cmd";
if (!defined $rv) {
ts_print("## ERROR: exec(): $!\n");
exit -1;
}
}
__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]