From: Dave Benjamin <dave@ramenlabs.com>
To: Savanni D'Gerinel <savanni@alyra.org>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Writing to argv[0]
Date: Thu, 09 Oct 2008 21:58:47 -0700 [thread overview]
Message-ID: <48EEE107.10004@ramenlabs.com> (raw)
In-Reply-To: <B6E6E9F5-F20E-49E9-8F98-E1522970837C@alyra.org>
Savanni D'Gerinel wrote:
> One possibility is setproctitle. It appears to be non-standard, but
> maybe a bit more standard than overwriting argv[0]. I know it works on
> Linux, and I see a FreeBSD man page for it.
Thanks, this was an interesting idea, though apparently setproctitle is
not available on Linux, only BSD. There have been some attempts to
expose it to Linux, including this one for Perl:
http://search.cpan.org/~opi/Sys-Proctitle-0.03/
You can see the gory details here:
http://search.cpan.org/src/OPI/Sys-Proctitle-0.03/libsetproctitle/setproctitle.c
It appears that it is possible to do this with OCaml, but it involves
building and linking in a shared library that defines the obsolete _init
method, fiddles around with memory relocating the environment and a
bunch of other nasty stuff I don't even want to understand. If it was
something simple like wrapping a libc function, I'd go for it, but this
is all too complicated for such a simple, stupid hack. =)
Thanks,
Dave
next prev parent reply other threads:[~2008-10-10 5:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-09 15:26 Dave Benjamin
2008-10-09 15:31 ` [Caml-list] " Basile STARYNKEVITCH
2008-10-09 15:43 ` Savanni D'Gerinel
2008-10-10 4:58 ` Dave Benjamin [this message]
2008-10-10 4:53 ` Dave Benjamin
2008-10-10 13:26 ` Dave Benjamin
2008-10-10 18:48 ` Jason Noakes
2008-10-10 20:11 ` Dave Benjamin
2008-10-10 15:11 ` Richard Jones
2008-10-10 16:33 ` Dave Benjamin
2008-10-10 16:59 ` Richard Jones
2008-10-10 20:19 ` Dave Benjamin
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=48EEE107.10004@ramenlabs.com \
--to=dave@ramenlabs.com \
--cc=caml-list@yquem.inria.fr \
--cc=savanni@alyra.org \
/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