3 # tests for (possibly emulated) waitpid
11 unless eval 'use Errno qw(EINVAL); 1';
13 unless eval 'use POSIX qw(WNOHANG); 1';
20 # [perl #85228] Broken waitpid
21 # $! = EINVAL; waitpid 0, 0; # would loop forever, even with WNOHANG
23 my $pid = waitpid(0, WNOHANG);
25 # depending on the platform, there's several possible values for
26 # $pid and $!, so I'm only testing that we don't loop forever.
28 # Some of the complications are:
30 # - watchdog() may be implemented with alarm() or fork, so there
31 # may or may not be children (this code doesn't use threads, so
32 # threads shouldn't be used)
34 # - the platform may or may not implement waitpid()/wait4()
36 pass("didn't block on waitpid(0, ...)");