Path: utzoo!mnetor!uunet!husc6!mit-eddie!uw-beaver!uw-june!pardo From: pardo@uw-june.UUCP (David Keppel) Newsgroups: comp.lang.c Subject: Re: exit(main(argc,argv,env)); Message-ID: <3858@uw-june.UUCP> Date: 18 Dec 87 19:31:59 GMT References: <10875@brl-adm.ARPA> <1451@houdi.UUCP> Reply-To: pardo@uw-june.UUCP (David Keppel) Organization: U of Washington, Computer Science, Seattle Lines: 11 [Why does crt0.c have "exit(main(argc,argv,argp));"? Isn't main called first?] I think that crt0.c is responsible for implementing the convention that main() is called first. crt0.c shags some environment pointers off of the stack and in some implementations may do other stuff. crt0.c is called directly by the kernel. This also means that it is the *last* thing executed before a user program terminates. (Sorry if I got this wrong, but I think that's how it goes). ;-D on (Conventions? NAHHHH... ) Pardo