From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MTxtT-0002Ul-EV for qemu-devel@nongnu.org; Thu, 23 Jul 2009 08:59:31 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MTxtO-0002RN-LV for qemu-devel@nongnu.org; Thu, 23 Jul 2009 08:59:30 -0400 Received: from [199.232.76.173] (port=46168 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MTxtO-0002RA-Ft for qemu-devel@nongnu.org; Thu, 23 Jul 2009 08:59:26 -0400 Received: from pf.freedaemonhosting.com ([66.210.104.252]:45507 helo=FreeDaemonHosting.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MTxtN-0007eV-Ql for qemu-devel@nongnu.org; Thu, 23 Jul 2009 08:59:26 -0400 Date: Thu, 23 Jul 2009 07:58:18 -0500 From: "Todd T. Fries" Subject: Re: [Qemu-devel] [PATCH] Allow setting qemu process name Message-ID: <20090723125818.GA12769@fries.net> References: <20090701093251.GA12447@basil.fritz.box> <20090723114715.GA826@fries.net> <20090723120142.GB19207@basil.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090723120142.GB19207@basil.fritz.box> Reply-To: todd@fries.net List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andi Kleen Cc: qemu-devel@nongnu.org Penned by Andi Kleen on 20090723 14:01.42, we have: | > | +static void set_proc_name(const char *prefix, const char *s) | > | +{ | > | +#ifdef __linux__ | > | + char name[16]; | > | + if (!s) | > | + return; | > | + /* Could rewrite argv[0] too, but that's a bit more complicated. | > | + This simple way is enough for `top'. */ | > | + snprintf(name, sizeof name, "%s-%.10s", prefix, s); | > | + prctl(PR_SET_NAME, name); | > #elif defined(__OpenBSD__) | > if (!s) | > setproctitle("%s-%.10s", prefix, s); | | Are you sure? A google codesearch on openbsd.org doesn't find | any references to PR_SET_NAME in the system. | | -Andi | | -- | ak@linux.intel.com -- Speaking for myself only. I didn't use PR_SET_NAME, read the code.. http://www.openbsd.org/cgi-bin/man.cgi?query=setproctitle -- Todd Fries .. todd@fries.net _____________________________________________ | \ 1.636.410.0632 (voice) | Free Daemon Consulting, LLC \ 1.405.227.9094 (voice) | http://FreeDaemonConsulting.com \ 1.866.792.3418 (FAX) | "..in support of free software solutions." \ sip:freedaemon@ekiga.net | \ sip:4052279094@ekiga.net \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ 37E7 D3EB 74D0 8D66 A68D B866 0326 204E 3F42 004A http://todd.fries.net/pgp.txt