为什么 C "never fail" 中的 exit() 函数?

Why does the exit() function in C "never fail"?

我正在阅读 Head First C,它说“exit() 是唯一保证永远不会 return 一个值并且永远不会失败的函数。”

  1. C 语言中是否还有其他函数不应该 return 任何可能的东西?

  2. 为什么 exit() 永远不会失败?

Are there other functions in C that are supposed to not return anything that might?

有点。 exec() 系列(execlexeclpexecve 等)将在成功时用新的可执行文件替换当前进程——因此永远不会 return 成功 - 或 return -1(并设置 errno)如果失败。

Why is it that exit() never ever fails?

怎么会失败呢?没有任何东西可以阻止进程退出。