qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Overwrite argv to set process title, eliminatin


From: Andreas Färber
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

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 <address@hidden>
---

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]