Re: [HACKERS] backend now show status in 'ps' - Mailing list pgsql-hackers

From Oleg Broytmann
Subject Re: [HACKERS] backend now show status in 'ps'
Date
Msg-id Pine.LNX.3.96.SK.980608193415.8666A-100000@torus.comus.ru
Whole thread Raw
In response to Re: [HACKERS] backend now show status in 'ps'  (Massimo Dal Zotto <dz@cs.unitn.it>)
List pgsql-hackers
Hello!

On Mon, 8 Jun 1998, Massimo Dal Zotto wrote:
> > This worked under BSDI, because if you say argv[1] = "test", and argc is
> > at least 2, it shows "test" in ps.  If argc is only one (they didn't use
> > any args), it will not show it, but I have added a nifty hack to the
> > postmaster to re-exec it so it is sure to have a least three args.  I
> > strip them off before processing.  You can see the patch in the patches
> > list.
>
> I believe, this won't work under Linux. I'm not 100% sure about it but from
> what I can remember Linux pass a copy of the original argv to the program
> and changing it doesn't change the argv strings shown by ps. You must zap
> the strings itself inside the page allocated for argv.
> I would suggest the following code which works fine also under linux, even
> with zero args.

   AFAIK the only "portable" way is to steal copy from well-known sendmail
hacks...

Oleg.
----
  Oleg Broytmann     http://members.tripod.com/~phd2/     phd2@earthling.net
           Programmers don't die, they just GOSUB without RETURN.


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Need some help on code
Next
From: Ewan Mellor
Date:
Subject: bool exported to user namespace