Will functions marked with __attribute__((__constructor__)) or
__attribute__((__destructor__)) satisfy your needs?
Compiler will insert calls to these functions gets into .init section of the
resulting ELF module which in turn will be called automatically at the program
startup time. I do not remember exactly, but there might be even priority
parameter you can specify with these attributes to manage the order in which
these functions will be called.

On 25-Jan-2001 Alfred Perlstein wrote:
> Has anyone done any work for FreeBSD or GNU C that allows for
> SYSINITs in userland, meaning just having to specify a function
> and arg to be called at a certain time during program startup?
> 
> I know you can do some evil magic with overloading special shared
> object symbols, but it is evil magic. :)
> 
> Anyone know of another OS that supports this?  Any standards for
> it on the way?
> 
> -- 
> -Alfred Perlstein - [[EMAIL PROTECTED]|[EMAIL PROTECTED]]
> "I have the heart of a child; I keep it in a jar on my desk."
> 
> 
> To Unsubscribe: send mail to [EMAIL PROTECTED]
> with "unsubscribe freebsd-hackers" in the body of the message

----------------------------------
E-Mail: Alexander N. Kabaev <[EMAIL PROTECTED]>
Date: 25-Jan-2001
Time: 15:10:40
----------------------------------


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to