4 ms·
What does this have to do with ttys or terminals though?
by donio 7y ago
What does this have to do with ttys or terminals though?
- jon-wood 7y agoThe TTY family of gems which this is a part of are focused on making development of CLI programs easier.
- pmurach 7y agoExit codes are only used in the context of terminal shells. So it seems appropriate to refer to terminals. Wouldn't you agree?
- tyingq 7y agoPerhaps, but wait() and waitpid() do fill the status, and have no concept of a tty.
- donio 7y agoThat's not the case at all. Every process produces an exit status when it terminates and many things besides interactive shells use them. Pretty much anything that runs a subprocess should retrieve the exit status to see if the child process was successful and log the failure if nothing else. Some random examples: Automated build systems like Jenkins typically use the exit status to decide if a build task has succeeded. `make` also uses exit codes to decide if a child task has succeeded and may abort the rest of the build based on that and return an exit code itself. A local mail delivery agent like maildrop may return different exit status depending on if it's a permanent or temporary failure and the mail transfer agent decides if it should retry the local delivery based on that. The exit status of a Docker of Kubernetes container is usually based on a process exit status too.