From owner-freebsd-hackers Mon Feb 14 0:10: 2 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from jason.argos.org (a1-3b058.neo.rr.com [24.93.181.58]) by builder.freebsd.org (Postfix) with ESMTP id 0C4DA4632 for ; Mon, 14 Feb 2000 00:10:00 -0800 (PST) Received: from localhost (mike@localhost) by jason.argos.org (8.9.1/8.9.1) with ESMTP id DAA20672; Mon, 14 Feb 2000 03:09:44 -0500 Date: Mon, 14 Feb 2000 03:09:44 -0500 (EST) From: Mike Nowlin To: Marc Wandschneider Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Loadable Code Modules? In-Reply-To: <003901bf76c1$302107e0$0300000a@katana> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > i was wondering if FreeBSD had a kind of like DLL capability? > > i'd like to be able to do something as follows: > > // ... construct char *fileName > moduleHandle = loadCodeModule(fileName); > (char *)(*fn char *) myfn; // ii'm pretty sure i screwed that up > myfn = getFunctionAddress(moduleHandle, "doSomethignCool"); > // use fn > releaseModule(moduleHandle); First, a friendly smack for using a WinDoze term (DLL).... "Thwack!" Second, an answer. Yes, they are supported... Take a look at the man page for "dlopen". I just had a need to (finally) use dynamically loadable objects in a program, and they're pretty easy to implement. (The "dlopen" and related functions apply to most modern UNIX variants.) --mike To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message