caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Richard Jones <rich@annexia.org>
To: caml-list@inria.fr
Subject: [Caml-list] [repost] Re: [another] mod_caml question
Date: Fri, 20 Feb 2004 17:27:38 +0000	[thread overview]
Message-ID: <20040220172738.GA8332@redhat.com> (raw)

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


                 reply	other threads:[~2004-02-20 17:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040220172738.GA8332@redhat.com \
    --to=rich@annexia.org \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).