caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] [repost] Re: [another] mod_caml question
@ 2004-02-20 17:27 Richard Jones
  0 siblings, 0 replies; only message in thread
From: Richard Jones @ 2004-02-20 17:27 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-02-20 17:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-20 17:27 [Caml-list] [repost] Re: [another] mod_caml question Richard Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).