Date: Wed, 30 Jul 1997 09:55:45 -0400 (EDT) From: "Art S. Kagel" To: "darn AT xl DOT ca" Cc: djgpp AT delorie DOT com Subject: Re: custom entry/exit code In-Reply-To: <33DC0947.605F@xl.ca> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Sun, 27 Jul 1997, Darren Grant wrote: > Hello, > > How do I link my own extra entry/exit code into a c project? The function atexit() will let you define a hierarchy of functions to execute when the program is exiting either through return from main() or a call to exit() (the _exit() function skips atexit processing). For entry code you will either have to live with executing stuff at the beginning of main() or write a custom verstion of crt0.o the startup module. Art S. Kagel, kagel AT bloomberg DOT com