From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <006a01c0ccb7$5990b0b0$95b9c6d4@SOMA> From: "Boyd Roberts" To: <9fans@cse.psu.edu> References: <20010423110853.3397219A61@mail.cse.psu.edu> <3AE4B6C2.28D1E595@arl.army.mil> Subject: Re: [9fans] the declaration of main() MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Date: Tue, 24 Apr 2001 14:09:01 +0200 Topicbox-Message-UUID: 8dff0064-eac9-11e9-9e20-41e7f4b1d025 From: "Douglas A. Gwyn" > I don't understand what you're talking about. In 7th Edition > Unix, which is where exit status and stdio were first widely > used, return from main() (with or without a value) would > automatically invoke the exit() function, which in turn > invoked cleanup(), which if any stdio function was used > would link with the buffer-flushing version instead of the > no-op version. Explicitly calling exit() would get the same > exit() function, the same cleanup() function, etc. yep, IIRC, sounds like the 7th ed /lib/crt0.s which eventually called _exit() [the syscall]. exit() was a library function which did the above and then called _exit().