qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] Allow setting qemu process name


From: Richard W.M. Jones
Subject: Re: [Qemu-devel] [PATCH] Allow setting qemu process name
Date: Fri, 24 Jul 2009 10:34:20 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

On Thu, Jul 23, 2009 at 06:47:16AM -0500, Todd T. Fries wrote:
> | +#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);
> | +#endif     

In case anyone is interested, setting process titles for all Un*x-like
platforms is _really_ complex.  This is how PostgreSQL does it:

http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/misc/ps_status.c?rev=1.33.2.1;content-type=text%2Fplain

Rich.

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v




reply via email to

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