From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MTwzj-0002DJ-03 for qemu-devel@nongnu.org; Thu, 23 Jul 2009 08:01:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MTwzd-0002AA-9d for qemu-devel@nongnu.org; Thu, 23 Jul 2009 08:01:53 -0400 Received: from [199.232.76.173] (port=34725 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MTwzd-00029u-1L for qemu-devel@nongnu.org; Thu, 23 Jul 2009 08:01:49 -0400 Received: from one.firstfloor.org ([213.235.205.2]:38208) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MTwzc-00043z-Gz for qemu-devel@nongnu.org; Thu, 23 Jul 2009 08:01:48 -0400 Date: Thu, 23 Jul 2009 14:01:42 +0200 From: Andi Kleen Subject: Re: [Qemu-devel] [PATCH] Allow setting qemu process name Message-ID: <20090723120142.GB19207@basil.fritz.box> References: <20090701093251.GA12447@basil.fritz.box> <20090723114715.GA826@fries.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090723114715.GA826@fries.net> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Todd T. Fries" Cc: Andi Kleen , qemu-devel@nongnu.org > | +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.