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 0DFFDBB84 for ; Fri, 10 Oct 2008 06:55:33 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAIV97kjOe3NG/2dsb2JhbAC9f4Fq X-IronPort-AV: E=Sophos;i="4.33,386,1220220000"; d="scan'208";a="15894784" 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 06:55:16 +0200 Received: (qmail 27323 invoked by uid 89); 10 Oct 2008 04:55:14 -0000 Received: from unknown (HELO ?192.168.1.99?) (98.165.129.233) by 0 with ESMTPS (DHE-RSA-AES256-SHA encrypted); 10 Oct 2008 04:55:14 -0000 Message-ID: <48EEDFE5.8080706@ramenlabs.com> Date: Thu, 09 Oct 2008 21:53:57 -0700 From: Dave Benjamin User-Agent: Mozilla-Thunderbird 2.0.0.16 (X11/20080724) MIME-Version: 1.0 To: Basile STARYNKEVITCH Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Writing to argv[0] References: <48EE22B0.3090404@ramenlabs.com> <48EE23BF.3080300@starynkevitch.net> In-Reply-To: <48EE23BF.3080300@starynkevitch.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; argv:01 basile:01 ocaml:01 argv:01 wrote:01 wrote:01 caml-list:01 posix:01 benjamin:01 benjamin:01 caml:02 caml:02 sys:03 seems:03 seems:03 Basile STARYNKEVITCH wrote: > Dave Benjamin wrote: >> Hi, >> >> 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. It doesn't seem like it's possible, even if I drop to C. Writing to "caml_exe_name" does nothing, and "caml_main_argv" is declared static. Oh well - judging from what I've read, it seems this technique has always been somewhat of a hack anyway... Thanks, Dave