OS/161 Reference Manual


_exit - terminate process


Standard C Library (libc, -lc)


#include <unistd.h>

_exit(int exitcode);


Cause the current process to exit. The exit code exitcode is reported back to other process(es) via the waitpid() call. The process id of the exiting process should not be reused until all processes expected to collect the exit code with waitpid have done so.

Traditionally exit codes are only seven bits wide (values 0-127); values outside this range were truncated. Portable code should not rely on being able to use exit codes outside this range. The definitions in OS/161 support a much wider range.

Return Values

_exit does not return.