return, exit, _exit summary

K. Richard rich at rexago1.UUCP
Thu Feb 6 03:30:44 AEST 1986


My original query:
>I'm on a binary only 3b2/300 running SV.2.2 so...
>What's the difference between leaving main by return() vs exit() vs _exit()?
>I mean in reality, by proposed standards (X3J11 can you hear me?), and
>functionally (like on my machine).  Who closes file descriptors?  Who reclaims
>memory?  What about shared memory?  What is a gate 4, 8?

It seems that return & exit both place exit status on the stack and allow the
process to die.  _exit does the same thing but does not flush io buffers.
Cleanup, ie, open files, semaphores, and shared memory segments are cleaned up
by the kernal when a process dies.

Thanks to all who shared.

K. Richard Magill

ps, the gate is a kernal call on a 3b2.



More information about the Comp.unix mailing list