setproctitle()

Started by Bruce Momjianover 25 years ago2 messages
#1Bruce Momjian
pgman@candle.pha.pa.us

Here is the new setproctitle() code, already committed for 7.0.1.

Works under BSDI, and I assume FreeBSD too.

---------------------------------------------------------------------------

#define PS_INIT_STATUS(argc, argv, execname, username, hostname, dbname) \
do { \
sprintf(Ps_status_buffer, "%s %s %s %s", execname, hostname, username, dbname); \
} while (0)

#define PS_CLEAR_STATUS() \
do { setproctitle("%s", Ps_status_buffer); } while (0)

#define PS_SET_STATUS(status) \
do { setproctitle("%s %s", Ps_status_buffer, (status)); } while (0)

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#2Peter Eisentraut
peter_e@gmx.net
In reply to: Bruce Momjian (#1)
Re: setproctitle()

Bruce Momjian writes:

Here is the new setproctitle() code, already committed for 7.0.1.

Isn't that 7.1 material?

Anyway, as I said before, I have this stuff all written up and it should
even work on non-BSD and non-Linux systems. I'll get it tested and then we
can put the issue to rest, I hope.

--
Peter Eisentraut Sernanders v�g 10:115
peter_e@gmx.net 75262 Uppsala
http://yi.org/peter-e/ Sweden