Differential D16234 Diff 45190 databases/postgresql95-server/files/patch-src_backend_utils_misc_ps__status.c
Changeset View
Changeset View
Standalone View
Standalone View
databases/postgresql95-server/files/patch-src_backend_utils_misc_ps__status.c
- This file was added.
--- src/backend/utils/misc/ps_status.c.orig 2018-05-07 20:55:28 UTC | |||||
+++ src/backend/utils/misc/ps_status.c | |||||
@@ -38,6 +38,9 @@ bool update_process_title = true; | |||||
/* | |||||
* Alternative ways of updating ps display: | |||||
* | |||||
+ * PS_USE_SETPROCTITLE_FAST | |||||
+ * use the function setproctitle_fast(const char *, ...) | |||||
+ * (newer FreeBSD systems) | |||||
* PS_USE_SETPROCTITLE | |||||
* use the function setproctitle(const char *, ...) | |||||
* (newer BSD systems) | |||||
@@ -59,7 +62,9 @@ bool update_process_title = true; | |||||
* don't update ps display | |||||
* (This is the default, as it is safest.) | |||||
*/ | |||||
-#if defined(HAVE_SETPROCTITLE) | |||||
+#if defined(HAVE_SETPROCTITLE_FAST) | |||||
+#define PS_USE_SETPROCTITLE_FAST | |||||
+#elif defined(HAVE_SETPROCTITLE) | |||||
#define PS_USE_SETPROCTITLE | |||||
#elif defined(HAVE_PSTAT) && defined(PSTAT_SETCMD) | |||||
#define PS_USE_PSTAT | |||||
@@ -259,7 +264,7 @@ init_ps_display(const char *username, const char *dbna | |||||
* Make fixed prefix of ps display. | |||||
*/ | |||||
-#ifdef PS_USE_SETPROCTITLE | |||||
+#if defined(PS_USE_SETPROCTITLE) || defined(PS_USE_SETPROCTITLE_FAST) | |||||
/* | |||||
* apparently setproctitle() already adds a `progname:' prefix to the ps | |||||
@@ -322,6 +327,8 @@ set_ps_display(const char *activity, bool force) | |||||
#ifdef PS_USE_SETPROCTITLE | |||||
setproctitle("%s", ps_buffer); | |||||
+#elif defined(PS_USE_SETPROCTITLE_FAST) | |||||
+ setproctitle_fast("%s", ps_buffer); | |||||
#endif | |||||
#ifdef PS_USE_PSTAT |