Received: from [140.186.70.92] (port=39391 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PFA0o-0004Pc-AH for qemu-devel@nongnu.org; Sun, 07 Nov 2010 13:30:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PFA0n-0006hr-2j for qemu-devel@nongnu.org; Sun, 07 Nov 2010 13:30:42 -0500 Received: from fmmailgate03.web.de ([217.72.192.234]:59692) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PFA0m-0006he-Sb for qemu-devel@nongnu.org; Sun, 07 Nov 2010 13:30:41 -0500 Message-Id: From: =?ISO-8859-1?Q?Andreas_F=E4rber?= In-Reply-To: <1289144652-23463-1-git-send-email-jwm@horde.net> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [Qemu-devel] [PATCH] Overwrite argv to set process title, eliminating 16-character prctl() limit. Date: Sun, 7 Nov 2010 19:27:22 +0100 References: <1289144652-23463-1-git-send-email-jwm@horde.net> Sender: andreas.faerber@web.de List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Morrissey Cc: qemu-devel@nongnu.org Am 07.11.2010 um 16:44 schrieb John Morrissey: > Linux seems to maintain the length of the original args, even when > the new > args are shorter and NULL-terminated, so the trailing whitespace in > ps(1) > output is probably unavoidable. I've seen the same result with other > daemons > that overwrite argv. > > Signed-off-by: John Morrissey > --- > diff --git a/os-posix.c b/os-posix.c > index 38c29d1..3ddf7e8 100644 > --- a/os-posix.c > +++ b/os-posix.c > @@ -149,20 +145,24 @@ char *os_find_datadir(const char *argv0) > #undef SHARE_SUFFIX > #undef BUILD_SUFFIX > > -void os_set_proc_name(const char *s) > +void os_set_proc_name(int argc, char **argv, const char *name) > { > -#if defined(PR_SET_NAME) > - char name[16]; > - if (!s) > +#ifdef CONFIG_LINUX Is PR_SET_NAME defined outside Linux? If so, then your patch removes the limited functionality for those platforms completely. Andreas