aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarc G. Fournier <scrappy@hub.org>2000-05-12 14:33:08 +0000
committerMarc G. Fournier <scrappy@hub.org>2000-05-12 14:33:08 +0000
commitbe4ae8f4b22e92f517122bbc1b16142009241d49 (patch)
tree8db36744f6cc6256fcf9faefc6bfbeff39f31180 /src
parent3383e8b82850f44ff470aff915e64ca5b9bb6563 (diff)
downloadpostgresql-be4ae8f4b22e92f517122bbc1b16142009241d49.tar.gz
postgresql-be4ae8f4b22e92f517122bbc1b16142009241d49.zip
this fixes the bug where setting the entry in he process table no longer works
under FreeBSD ... basically, if setproctitle() exists, use it ... the draw back right now is the PS_SET_STATUS stuff doesn't work, but am looking into that one right now ... at lesat now you can see who is connecting where and from where ...
Diffstat (limited to 'src')
-rw-r--r--src/include/utils/ps_status.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/include/utils/ps_status.h b/src/include/utils/ps_status.h
index 8bc28e5d63b..b786c5415ad 100644
--- a/src/include/utils/ps_status.h
+++ b/src/include/utils/ps_status.h
@@ -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>