Hacker News new | ask | show | jobs
by beefhash 2336 days ago
Meanwhile on OpenBSD[1]...

"A few programs exit with the following non-portable error codes. Do not use them."

[1] https://man.openbsd.org/sysexits

1 comments

In this context "Do not use them.", these are reserved codes and shouldn't be redefined in your programs to mean something entirely different. So codes in range 64-78 are a standard across Unix systems. Usually, specific program codes are best served using codes below 64.

I have included a method that helps you check if a code is reserved or not. For example, TTY::Exit.exit_reserved?(126) will return true as this is a status used by Bash to indicate a problem with executing a command.