delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/30/09:56:05

Date: Wed, 30 Jul 1997 09:55:45 -0400 (EDT)
From: "Art S. Kagel" <kagel AT ns1 DOT bloomberg DOT com>
To: "<removeme AT delorie DOT com>darn AT xl DOT ca" <removeme AT delorie DOT com>
Cc: djgpp AT delorie DOT com
Subject: Re: custom entry/exit code
In-Reply-To: <33DC0947.605F@xl.ca>
Message-Id: <Pine.D-G.3.91.970730090823.15307D-100000@dg1>
Mime-Version: 1.0

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019