Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Richard Jones <rich@annexia.org>
To: Dave Benjamin <dave@ramenlabs.com>
Cc: Basile STARYNKEVITCH <basile@starynkevitch.net>,
	caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Writing to argv[0]
Date: Fri, 10 Oct 2008 17:59:44 +0100	[thread overview]
Message-ID: <20081010165944.GB16402@annexia.org> (raw)
In-Reply-To: <alpine.DEB.2.00.0810100929340.18041@spoomusic.com>

On Fri, Oct 10, 2008 at 09:33:17AM -0700, Dave Benjamin wrote:
> On Fri, 10 Oct 2008, Richard Jones wrote:
> 
> >On Thu, Oct 09, 2008 at 05:31:11PM +0200, Basile STARYNKEVITCH wrote:
> >>Dave Benjamin wrote:
> >>>Is there any way for an OCaml program to change its name in the process
> >>>table? Assigning to Sys.argv.(0) has no effect.
> >>
> >>Write a C wrapper for that. And this trick seems Linux specific (it has
> >>no sense in Posix) -maybe working on few other OSes.
> >
> >http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/misc/ps_status.c?rev=1.33.2.1;content-type=text%2Fplain
> >
> >PostgreSQL offers this code to change the proc title on many different
> >platforms.
> 
> Thanks, Rich - this looks very comprehensive - they even go out of their 
> way to support Windows! =) However, unless I'm mistaken, I still have the 
> problem of not being able to access "argc" and "argv" to pass into 
> save_ps_display_args(). I suppose I could embed OCaml in a C program...

Yes, it was intended more as a joke rather than a serious suggestion :-)

I was also talking to Jim Meyering about the possibility of adding
this code to gnulib[1] which would make it more widely available to
all programs.

Rich.

[1] http://www.gnu.org/software/gnulib/

-- 
Richard Jones
Red Hat


  reply	other threads:[~2008-10-10 17: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
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 [this message]
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=20081010165944.GB16402@annexia.org \
    --to=rich@annexia.org \
    --cc=basile@starynkevitch.net \
    --cc=caml-list@yquem.inria.fr \
    --cc=dave@ramenlabs.com \
    /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