Hacker News new | ask | show | jobs
by Arnt 3879 days ago
Why is pledge() int rather than void? All the examples exit() in one way or another, so why doesn't pledge() do that for them?
1 comments

The examples are just examples, the uses in the tree are different. For example, ksh doesn't exit if pledge fails, it just prints an error about why it failed and keeps running (imagine how fun it would be the shell did just keep terminating). Other programs use their own logging to report the error, for example httpd logs the error the same way it logs all other fatal errors before it exits.