Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site rexago1.UUCP Path: utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!petrus!bellcore!decvax!cwruecmp!rexago1!rich From: rich@rexago1.UUCP (K. Richard ) Newsgroups: net.lang.c,net.unix Subject: return, exit, _exit summary Message-ID: <186@rexago1.UUCP> Date: Wed, 5-Feb-86 12:30:44 EST Article-I.D.: rexago1.186 Posted: Wed Feb 5 12:30:44 1986 Date-Received: Fri, 7-Feb-86 20:36:51 EST Distribution: net Organization: Roadway Express Inc., Akron, OH Lines: 17 Xref: watmath net.lang.c:7778 net.unix:7032 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.