From owner-freebsd-hackers Thu Jan 25 12:16:29 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 0FD9237B402; Thu, 25 Jan 2001 12:16:08 -0800 (PST) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id f0PKG7C27857; Thu, 25 Jan 2001 12:16:07 -0800 (PST) Date: Thu, 25 Jan 2001 12:16:07 -0800 From: Alfred Perlstein To: John Baldwin Cc: hackers@FreeBSD.ORG Subject: Re: SYSINIT for userland? Message-ID: <20010125121607.V26076@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 jhb@FreeBSD.ORG on Thu, Jan 25, 2001 at 12:07:54PM -0800 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * John Baldwin [010125 12:09] wrote: > > On 25-Jan-01 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? > > Use C++ with static instances of classes that have constructors. I've got a pretty good idea of how it could be done in C++. Have a global list that each object adds itself to in sorted order (via static constructor), the manipulation should be serialized, but this still isn't a solution for C. -- -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