Subject: Re: itimer, pthreads, and checkpointing
To: Michael Graff <explorer@flame.org>
From: Simon Burge <simonb@netbsd.org>
List: tech-kern
Date: 11/16/1999 11:36:41
Michael Graff wrote:

> Question:  How do I arrange for a function (say, pthread_init()), to
> be called before main()?

You could take a look at src/lib/csu and see how things like __progname
are set up.  If pthread_init() were a weak symbol that was always called
and in the non-threaded case was just an empty function this might work.
I dunno if this would be considered too hackish though...

Just maybe you could also leverage off how c++ constructors are called
using ELF .init sections and the like, but I have no idea how these
work :)

Simon.