On 11 Jun 2002, Josts Smokehouse wrote:
> t/08fork..........Bad profile: $hz=1000; at /usr/local/perl/bin/dprofpp line 646,
><fh> line 14.
> # Failed test
>(/net/ibm0176/disc1/home/kriegjcb/.cpanplus/build/Devel-Profiler-0.04/blib/lib/Devel/Profiler/Test.pm
> at line 65)
> # got: ''
> # expected: 'main::foo
> # main::bar
> # main::foo
> # main::bar
> # '
> # Looks like you failed 1 tests of 2.
Hmmmm. I'm stumped. Does fork() and $$ behave differently under Solaris?
Could you run this for me and send me the output?
#!/usr/bin/perl
$parent = $$;
if (fork) {
print "IN PARENT: $parent $$\n";
} else {
print "IN CHILD: $parent $$\n";
}
On Linux this prints:
IN PARENT: 15595 15595
IN CHILD: 15595 15596
Which means I can use $$ and a saved parent PID to detect a fork. But
that doesn't seem to be working on Solaris judging by the test failure.
-sam