English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] [repost] Re: [another] mod_caml question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-02-20 (17:27)
From: Richard Jones <rich@a...>
Subject: [Caml-list] [repost] Re: [another] mod_caml question
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().


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