|
|
|
|
@ -11,7 +11,27 @@ |
|
|
|
|
#ifndef PS_STATUS_H |
|
|
|
|
#define PS_STATUS_H |
|
|
|
|
|
|
|
|
|
#ifdef linux |
|
|
|
|
#ifdef HAVE_SETPROCTITLE |
|
|
|
|
|
|
|
|
|
extern char Ps_status_buffer[]; |
|
|
|
|
|
|
|
|
|
#undef PS_DEFINE_BUFFER |
|
|
|
|
|
|
|
|
|
#define PS_INIT_STATUS(argc, argv, execname, username, hostname, dbname) \ |
|
|
|
|
do { \
|
|
|
|
|
Assert(argc >= 5); \
|
|
|
|
|
setproctitle("%s %s %s %s %s", execname, hostname, username, dbname, Ps_status_buffer); \
|
|
|
|
|
} while (0) |
|
|
|
|
|
|
|
|
|
#define PS_CLEAR_STATUS() \ |
|
|
|
|
do { Ps_status_buffer[0] = '\0'; } while (0) |
|
|
|
|
|
|
|
|
|
#define PS_SET_STATUS(status) \ |
|
|
|
|
do { strcpy(Ps_status_buffer, (status)); } while (0) |
|
|
|
|
|
|
|
|
|
#define PS_STATUS (Ps_status_buffer) |
|
|
|
|
|
|
|
|
|
#elif defined(linux) |
|
|
|
|
|
|
|
|
|
#include <string.h> |
|
|
|
|
|
|
|
|
|
|