Here is the confusing page. Search for "/bin/ps". The line is:
ProcessHandle ph(launch("/bin/ps", args, &outPipe, 0, 0));
Shouldnt it be:
ProcessHandle ph(launch("/bin/ps", args, 0, &outPipe, 0));
?
Here is the confusing page. Search for "/bin/ps". The line is:
ProcessHandle ph(launch("/bin/ps", args, &outPipe, 0, 0));
Shouldnt it be:
ProcessHandle ph(launch("/bin/ps", args, 0, &outPipe, 0));
?
Yes, your observation is confirmed - the order of the last three args is indeed stdin, stdout, stderr, so the outPipe in the docs is erroneously getting passed as the input instead. I have no more idea than you have, how this doc error may have gone unnoticed!-)