我读过man 3p wait
,但我只能找到以下语句:
In this case, if the value of the argument
stat_loc
is not a null pointer, information shall be stored in the location pointed to bystat_loc
.
我也可以在 google 上找到 opengroup 页面,但与 man 3p wait
几乎完全相同。
我在哪里可以找到明确声明 wait(NULL)
定义明确?
最佳答案
我认为您不会找到明确的声明,但这是针对这种情况的典型措辞。如果它们意味着不允许 NULL,您会看到类似“stat_loc
应为非 NULL 指针”或“stat_loc
应指向对象... "或 "如果 stat_loc
为 NULL,则行为未定义"。
在这种情况下,它只是意味着如果您传递一个空指针,则定义的行为是 wait
只是忽略它,并且根本不会将该信息存储在任何地方。
关于c - wait(NULL) 定义明确吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68644506/