From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA25833; Fri, 20 Feb 2004 18:27:42 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA25723 for ; Fri, 20 Feb 2004 18:27:40 +0100 (MET) Received: from aomori.annexia.org (annexia.force9.co.uk [212.56.101.183]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i1KHRdae012133 for ; Fri, 20 Feb 2004 18:27:39 +0100 Received: from rich by aomori.annexia.org with local (Exim 3.36 #1 (Debian)) id 1AuER9-0002Ab-00 for ; Fri, 20 Feb 2004 17:27:39 +0000 Date: Fri, 20 Feb 2004 17:27:38 +0000 To: caml-list@inria.fr Subject: [Caml-list] [repost] Re: [another] mod_caml question Message-ID: <20040220172738.GA8332@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.4i From: Richard Jones X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 2004:99 usages:01 dynlink:01 dynlink:01 chroot:01 non-standard:01 argv:01 dynamically:01 dlopen:01 type-safe:01 ltd:98 linked:01 caml:01 caml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk To: Ranjan Bagchi Cc: caml-list@inria.fr Subject: Re: [another] mod_caml question On Fri, Feb 20, 2004 at 07:16:23AM -0800, Ranjan Bagchi wrote: > So what's the role of the caml executable? I read the apache handler > code, and it looks like from the standpoint of the mod_caml c code, it's > bytecode which is loaded by the caml interpreter. But why's it > executable? Are there other usages? It's simply there to workaround a problem with Dynlink. In brief when you use Dynlink, it tries to read your current executable to find the symbol table in the bytecode. This way it can find out what symbols are already part of the environment. Of course there are all sorts of problems with doing this in a Unix environment: eg. you might, quite legitimately, have unlink(2)ed the executable, so it no longer exists. Or you might not have read permission on your own executable. Or you might not be able to find the path to your own executable (think chroot(2), or being passed a non-standard argv or PATH). etc. The problem with mod_caml is that there's no executable at all, because the module is dynamically linked (using dlopen(3)) into Apache. Thus we have to go through some hoops to build a fake executable and tell Dynlink to use this to find its symbol table. This is the purpose of the code in mod_caml_c:init(). Rich. -- Richard Jones. http://www.annexia.org/ http://www.j-london.com/ Merjis Ltd. http://www.merjis.com/ - improving website return on investment Perl4Caml lets you use any Perl library in your type-safe Objective CAML programs. http://www.merjis.com/developers/perl4caml/ ----- End forwarded message ----- ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners