From owner-freebsd-hackers Thu Jan 25 12:20:31 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 30EC237B6A2 for ; Thu, 25 Jan 2001 12:20:01 -0800 (PST) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id f0PKJxQ27939; Thu, 25 Jan 2001 12:19:59 -0800 (PST) Date: Thu, 25 Jan 2001 12:19:59 -0800 From: Alfred Perlstein To: "Alexander N. Kabaev" Cc: hackers@FreeBSD.ORG Subject: Re: SYSINIT for userland? Message-ID: <20010125121959.W26076@fw.wintelcom.net> References: <20010125115253.T26076@fw.wintelcom.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from ak03@gte.com on Thu, Jan 25, 2001 at 03:16:09PM -0500 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Alexander N. Kabaev [010125 12:16] wrote: > 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. Actually, the order can be kludged by just having these __constructors__ sort themselves into a list. Then all you need is a function call in main() to actually start these puppies up. :) It's still a bit off what I was looking for which would be putting these hooks into shared libaries hinged on pthread initialization, dns init, etc... -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] "I have the heart of a child; I keep it in a jar on my desk." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message