[% setvar title wait() and waitpid() should return false on failure %]

This file is part of the Perl 6 Archive

Note: these documents may be out of date. Do not use as reference!

To see what is currently happening visit http://www.perl6.org/

TITLE

wait() and waitpid() should return false on failure

VERSION

  Maintainer: Nathan Torkington <gnat@frii.com>
  Date: 13 Sep 2000
  Mailing List: perl6-language@perl.org
  Number: 220
  Version: 1
  Status: Developing

ABSTRACT

All system calls in Perl should return false on failure.

DESCRIPTION

wait() and waitpid() return -1 on failure. They should return undef, and return "0 but true" if the system call returned 0.

IMPLEMENTATION

Straightforward. The perl526 translator simply wraps the perl6 wait() and waitpid():

  do { my $r = waitpid(...); return -1 if !defined $r;
       return 0 if !$r; $r }

REFERENCES

the perlfunc manpage for information on waitpid() and wait()