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 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 701B1BB84 for ; Fri, 10 Oct 2008 22:19:49 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAFdV70jOe3NG/2dsb2JhbAC9FoFs X-IronPort-AV: E=Sophos;i="4.33,391,1220220000"; d="scan'208";a="17957421" Received: from spoomusic.com ([206.123.115.70]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 10 Oct 2008 22:19:48 +0200 Received: (qmail 32641 invoked by uid 89); 10 Oct 2008 20:19:46 -0000 Received: from localhost (127.0.0.1) by 0 with ESMTPS (DHE-RSA-AES256-SHA encrypted); 10 Oct 2008 20:19:46 -0000 Date: Fri, 10 Oct 2008 13:19:46 -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: <20081010165944.GB16402@annexia.org> Message-ID: References: <48EE22B0.3090404@ramenlabs.com> <48EE23BF.3080300@starynkevitch.net> <20081010151143.GA15400@annexia.org> <20081010165944.GB16402@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 argc:01 argv:01 ocaml:01 rpms:01 low-level:01 cpan:01 10,:98 0.03:98 wrote:01 wrote:01 dmitry:01 caml-list:01 benjamin:01 benjamin:01 On Fri, 10 Oct 2008, Richard Jones wrote: > On Fri, Oct 10, 2008 at 09:33:17AM -0700, Dave Benjamin wrote: >> >> 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'm starting to wonder if this all isn't one big joke that went over my head. =) > 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. Yeah, it would be really nice to get a safe version of this feature packaged up somewhere that could be installed easily. If you search the web for "libproctitle" you'll find a library by Dmitry V. Levin which it looks like he was trying to get into Debian earlier this year. I couldn't find it in unstable, though. There are RPMs available here: http://sisyphus.ru/srpm/Sisyphus/setproctitle/get That Perl module also has the low-level stuff broken out into a C library, though it doesn't appear like any attempt was made to release it independently: http://search.cpan.org/src/OPI/Sys-Proctitle-0.03/libsetproctitle/ Hmm. Maybe it's time to replace "ps" with something more modern... this is all so dirty, yet it seems like monitoring process status is still a useful thing to be able to do, especially with the proliferation of multi-process servers. Dave