Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

fork(2)

wait(2)

exit(2)

ERROR(3c)



EXIT(3C)                COMMAND REFERENCE                EXIT(3C)



NAME
     exit - terminate a process

SYNOPSIS
     exit(status)
     int status;
     extern int _last_err

DESCRIPTION
     Exit terminates a process with the following consequences:

          All of the descriptors open in the calling process are
          closed.

          If the parent process of the calling process is
          executing a wait or is interested in the SIGCHLD
          signal, then it is notified of the calling process's
          termination and the low-order eight bits of status are
          made available to it; see wait(2). The low-order eight
          bits of status are available to the parent process.

          If the status given to exit is 0 or the status is not
          given, the status is replaced by the value of the last
          warning code given to the subroutine ERROR(3c). The
          value of this warning code is stored in the variable
          _last_err, and may be set by user programs in cases
          where ERROR cannot be used.

          The parent process ID of all of the calling process's
          existing child processes is also set to 1. This means
          that the initialization process (see intro(2)) inherits
          each of these processes as well.

RETURN VALUE
     This call never returns.

CAVEATS
     Programs that "fall off the end" (for example, do not
     explicitly call exit and do not explicitly return with a
     value) do not exit with any useful value.  In this cases,
     any exit code may result.

     Calling exit with no parameters causes the same action as
     calling exit with a value of 0.

SEE ALSO
     fork(2), wait(2), exit(2), and ERROR(3c).








Printed 5/12/88                                                 1



%%index%%
na:264,78;
sy:342,551;
de:893,1577;
rv:2470,154;
ca:2624,515;
se:3139,175;
%%index%%000000000108

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026