I've read man 3p wait, but what I could only find was this statement:
In this case, if the value of the argument
stat_locis not a null pointer, information shall be stored in the location pointed to bystat_loc.
I could also find opengroup page on google, but it was almost exactly same with man 3p wait.
Where can I find explicit statement that says wait(NULL) is well defined?
I don't think you'll find an explicit statement, but this is typical wording for this situation. If they meant that NULL was not allowed, you would see a statement like "stat_loc shall be a non-NULL pointer" or "stat_loc shall point to an object..." or "if stat_loc is NULL, the behavior is undefined".
In this case, it just means that if you pass a null pointer, the defined behavior is that wait just ignores it, and doesn't store that information anywhere at all.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With