summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-01-27 19:43:35 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-01-27 19:43:35 +0000
commit030866aa8d0911636ef2210b710f544fd2c85c8e (patch)
tree78db3f262afc04ec35b86c1618d43068a5f7851c /t
parentb181b6fb157975572d5e0c5c46c1594e317a45ba (diff)
downloadperl-030866aa8d0911636ef2210b710f544fd2c85c8e.tar.gz
document unimplemented status of forking pipe open() on windows
p4raw-id: //depot/perl@4914
Diffstat (limited to 't')
-rwxr-xr-xt/op/fork.t47
1 files changed, 47 insertions, 0 deletions
diff --git a/t/op/fork.t b/t/op/fork.t
index 11efa79d17..f3d74f978f 100755
--- a/t/op/fork.t
+++ b/t/op/fork.t
@@ -320,3 +320,50 @@ BEGIN {
#print "outer\n"
EXPECT
inner
+########
+sub pipe_to_fork ($$) {
+ my $parent = shift;
+ my $child = shift;
+ pipe($child, $parent) or die;
+ my $pid = fork();
+ die "fork() failed: $!" unless defined $pid;
+ close($pid ? $child : $parent);
+ $pid;
+}
+
+if (pipe_to_fork('PARENT','CHILD')) {
+ # parent
+ print PARENT "pipe_to_fork\n";
+ close PARENT;
+}
+else {
+ # child
+ while (<CHILD>) { print; }
+ close CHILD;
+ exit;
+}
+
+sub pipe_from_fork ($$) {
+ my $parent = shift;
+ my $child = shift;
+ pipe($parent, $child) or die;
+ my $pid = fork();
+ die "fork() failed: $!" unless defined $pid;
+ close($pid ? $child : $parent);
+ $pid;
+}
+
+if (pipe_from_fork('PARENT','CHILD')) {
+ # parent
+ while (<PARENT>) { print; }
+ close PARENT;
+}
+else {
+ # child
+ print CHILD "pipe_from_fork\n";
+ close CHILD;
+ exit;
+}
+EXPECT
+pipe_from_fork
+pipe_to_fork