aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2023-02-17 15:18:18 +1300
committerThomas Munro <tmunro@postgresql.org>2023-02-17 15:18:18 +1300
commitd2ea2d310dfdc40328aca5b6c52225de78432e01 (patch)
tree4ffd24866a585fa8de3899cd84a551465ddc4008 /src
parenta0fa18cc0d6e4dc3dc24b57ae11253356c55d6c4 (diff)
downloadpostgresql-d2ea2d310dfdc40328aca5b6c52225de78432e01.tar.gz
postgresql-d2ea2d310dfdc40328aca5b6c52225de78432e01.zip
Remove obsolete platforms from ps_status.c.
Time to remove various code, comments and configure/meson probes relating to ancient BSD, SunOS, GNU/Hurd, IRIX, NeXT and Unixware. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CA%2BhUKGJMNGUAqf27WbckYFrM-Mavy0RKJvocfJU%3DJ2XcAZyv%2Bw%40mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/misc/ps_status.c55
-rw-r--r--src/include/pg_config.h.in3
-rw-r--r--src/tools/msvc/Solution.pm1
3 files changed, 9 insertions, 50 deletions
diff --git a/src/backend/utils/misc/ps_status.c b/src/backend/utils/misc/ps_status.c
index 06bdc2afd16..c99a4f10fa5 100644
--- a/src/backend/utils/misc/ps_status.c
+++ b/src/backend/utils/misc/ps_status.c
@@ -15,10 +15,6 @@
#include "postgres.h"
#include <unistd.h>
-#ifdef HAVE_PS_STRINGS
-#include <machine/vmparam.h> /* for old BSD */
-#include <sys/exec.h>
-#endif
#if defined(__darwin__)
#include <crt_externs.h>
#endif
@@ -39,16 +35,10 @@ bool update_process_title = DEFAULT_UPDATE_PROCESS_TITLE;
*
* PS_USE_SETPROCTITLE_FAST
* use the function setproctitle_fast(const char *, ...)
- * (newer FreeBSD systems)
+ * (FreeBSD)
* PS_USE_SETPROCTITLE
* use the function setproctitle(const char *, ...)
- * (newer BSD systems)
- * PS_USE_PS_STRINGS
- * assign PS_STRINGS->ps_argvstr = "string"
- * (some BSD systems)
- * PS_USE_CHANGE_ARGV
- * assign argv[0] = "string"
- * (some other BSD systems)
+ * (other BSDs)
* PS_USE_CLOBBER_ARGV
* write over the argv and environment area
* (Linux and most SysV-like systems)
@@ -62,11 +52,7 @@ bool update_process_title = DEFAULT_UPDATE_PROCESS_TITLE;
#define PS_USE_SETPROCTITLE_FAST
#elif defined(HAVE_SETPROCTITLE)
#define PS_USE_SETPROCTITLE
-#elif defined(HAVE_PS_STRINGS)
-#define PS_USE_PS_STRINGS
-#elif (defined(BSD) || defined(__hurd__)) && !defined(__darwin__)
-#define PS_USE_CHANGE_ARGV
-#elif defined(__linux__) || defined(_AIX) || defined(__sgi) || (defined(sun) && !defined(BSD)) || defined(__svr5__) || defined(__darwin__)
+#elif defined(__linux__) || defined(_AIX) || defined(__sun) || defined(__darwin__)
#define PS_USE_CLOBBER_ARGV
#elif defined(WIN32)
#define PS_USE_WIN32
@@ -186,9 +172,6 @@ save_ps_display_args(int argc, char **argv)
new_environ[i] = NULL;
environ = new_environ;
}
-#endif /* PS_USE_CLOBBER_ARGV */
-
-#if defined(PS_USE_CHANGE_ARGV) || defined(PS_USE_CLOBBER_ARGV)
/*
* If we're going to change the original argv[] then make a copy for
@@ -226,15 +209,15 @@ save_ps_display_args(int argc, char **argv)
#if defined(__darwin__)
/*
- * macOS (and perhaps other NeXT-derived platforms?) has a static copy
- * of the argv pointer, which we may fix like so:
+ * macOS has a static copy of the argv pointer, which we may fix like
+ * so:
*/
*_NSGetArgv() = new_argv;
#endif
argv = new_argv;
}
-#endif /* PS_USE_CHANGE_ARGV or PS_USE_CLOBBER_ARGV */
+#endif /* PS_USE_CLOBBER_ARGV */
return argv;
}
@@ -271,25 +254,10 @@ init_ps_display(const char *fixed_part)
/* If ps_buffer is a pointer, it might still be null */
if (!ps_buffer)
return;
-#endif
-
- /*
- * Overwrite argv[] to point at appropriate space, if needed
- */
-#ifdef PS_USE_CHANGE_ARGV
- save_argv[0] = ps_buffer;
- save_argv[1] = NULL;
-#endif /* PS_USE_CHANGE_ARGV */
-
-#ifdef PS_USE_CLOBBER_ARGV
- {
- int i;
-
- /* make extra argv slots point at end_of_area (a NUL) */
- for (i = 1; i < save_argc; i++)
- save_argv[i] = ps_buffer + ps_buffer_size;
- }
+ /* make extra argv slots point at end_of_area (a NUL) */
+ for (int i = 1; i < save_argc; i++)
+ save_argv[i] = ps_buffer + ps_buffer_size;
#endif /* PS_USE_CLOBBER_ARGV */
/*
@@ -369,11 +337,6 @@ set_ps_display(const char *activity)
setproctitle_fast("%s", ps_buffer);
#endif
-#ifdef PS_USE_PS_STRINGS
- PS_STRINGS->ps_nargvstr = 1;
- PS_STRINGS->ps_argvstr = ps_buffer;
-#endif /* PS_USE_PS_STRINGS */
-
#ifdef PS_USE_CLOBBER_ARGV
/* pad unused memory; need only clobber remainder of old status string */
if (last_status_len > ps_buffer_cur_len)
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index 2490bf8ace9..20c82f59798 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -334,9 +334,6 @@
/* Define to 1 if you have the `ppoll' function. */
#undef HAVE_PPOLL
-/* Define to 1 if the PS_STRINGS thing exists. */
-#undef HAVE_PS_STRINGS
-
/* Define if you have POSIX threads libraries and header files. */
#undef HAVE_PTHREAD
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 53990504924..5eaea6355e8 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -308,7 +308,6 @@ sub GenerateFiles
HAVE_POSIX_FADVISE => undef,
HAVE_POSIX_FALLOCATE => undef,
HAVE_PPOLL => undef,
- HAVE_PS_STRINGS => undef,
HAVE_PTHREAD => undef,
HAVE_PTHREAD_BARRIER_WAIT => undef,
HAVE_PTHREAD_IS_THREADED_NP => undef,