Not sure this helps, but the only time I've seen waitpid return -1 (aka 255) when it should have returned something useful was when I was mixing it with perl's builtin backticks/system()/rx() which reap children themselves (i.e. one starts reaping children it's not responsible for).