From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id CAB73BB84 for ; Fri, 10 Oct 2008 18:33:19 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAJwg70jOe3NG/2dsb2JhbAC9MoFs X-IronPort-AV: E=Sophos;i="4.33,390,1220220000"; d="scan'208";a="15935607" Received: from spoomusic.com ([206.123.115.70]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 10 Oct 2008 18:33:19 +0200 Received: (qmail 18714 invoked by uid 89); 10 Oct 2008 16:33:17 -0000 Received: from localhost (127.0.0.1) by 0 with ESMTPS (DHE-RSA-AES256-SHA encrypted); 10 Oct 2008 16:33:17 -0000 Date: Fri, 10 Oct 2008 09:33:17 -0700 (MST) From: Dave Benjamin X-X-Sender: ramen@spoomusic.com To: Richard Jones Cc: Basile STARYNKEVITCH , caml-list@yquem.inria.fr Subject: Re: [Caml-list] Writing to argv[0] In-Reply-To: <20081010151143.GA15400@annexia.org> Message-ID: References: <48EE22B0.3090404@ramenlabs.com> <48EE23BF.3080300@starynkevitch.net> <20081010151143.GA15400@annexia.org> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam: no; 0.00; argv:01 0200,:01 basile:01 ocaml:01 argv:01 cvsweb:01 utils:01 argc:01 ocaml:01 wrote:01 wrote:01 caml-list:01 posix:01 benjamin:01 benjamin:01 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... Dave