mirror of
https://github.com/postgres/postgres.git
synced 2025-04-27 22:56:53 +03:00
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
This commit is contained in:
parent
a0fa18cc0d
commit
d2ea2d310d
35
configure
vendored
35
configure
vendored
@ -16278,41 +16278,6 @@ cat >>confdefs.h <<_ACEOF
|
|||||||
_ACEOF
|
_ACEOF
|
||||||
|
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PS_STRINGS" >&5
|
|
||||||
$as_echo_n "checking for PS_STRINGS... " >&6; }
|
|
||||||
if ${pgac_cv_var_PS_STRINGS+:} false; then :
|
|
||||||
$as_echo_n "(cached) " >&6
|
|
||||||
else
|
|
||||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
|
||||||
/* end confdefs.h. */
|
|
||||||
#include <machine/vmparam.h>
|
|
||||||
#include <sys/exec.h>
|
|
||||||
|
|
||||||
int
|
|
||||||
main ()
|
|
||||||
{
|
|
||||||
PS_STRINGS->ps_nargvstr = 1;
|
|
||||||
PS_STRINGS->ps_argvstr = "foo";
|
|
||||||
;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
_ACEOF
|
|
||||||
if ac_fn_c_try_link "$LINENO"; then :
|
|
||||||
pgac_cv_var_PS_STRINGS=yes
|
|
||||||
else
|
|
||||||
pgac_cv_var_PS_STRINGS=no
|
|
||||||
fi
|
|
||||||
rm -f core conftest.err conftest.$ac_objext \
|
|
||||||
conftest$ac_exeext conftest.$ac_ext
|
|
||||||
fi
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_var_PS_STRINGS" >&5
|
|
||||||
$as_echo "$pgac_cv_var_PS_STRINGS" >&6; }
|
|
||||||
if test "$pgac_cv_var_PS_STRINGS" = yes ; then
|
|
||||||
|
|
||||||
$as_echo "#define HAVE_PS_STRINGS 1" >>confdefs.h
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
ac_fn_c_check_func "$LINENO" "explicit_bzero" "ac_cv_func_explicit_bzero"
|
ac_fn_c_check_func "$LINENO" "explicit_bzero" "ac_cv_func_explicit_bzero"
|
||||||
if test "x$ac_cv_func_explicit_bzero" = xyes; then :
|
if test "x$ac_cv_func_explicit_bzero" = xyes; then :
|
||||||
$as_echo "#define HAVE_EXPLICIT_BZERO 1" >>confdefs.h
|
$as_echo "#define HAVE_EXPLICIT_BZERO 1" >>confdefs.h
|
||||||
|
13
configure.ac
13
configure.ac
@ -1849,19 +1849,6 @@ AC_CHECK_DECLS([pwritev], [], [AC_LIBOBJ(pwritev)], [#include <sys/uio.h>])
|
|||||||
# This is probably only present on macOS, but may as well check always
|
# This is probably only present on macOS, but may as well check always
|
||||||
AC_CHECK_DECLS(F_FULLFSYNC, [], [], [#include <fcntl.h>])
|
AC_CHECK_DECLS(F_FULLFSYNC, [], [], [#include <fcntl.h>])
|
||||||
|
|
||||||
AC_CACHE_CHECK([for PS_STRINGS], [pgac_cv_var_PS_STRINGS],
|
|
||||||
[AC_LINK_IFELSE([AC_LANG_PROGRAM(
|
|
||||||
[#include <machine/vmparam.h>
|
|
||||||
#include <sys/exec.h>
|
|
||||||
],
|
|
||||||
[PS_STRINGS->ps_nargvstr = 1;
|
|
||||||
PS_STRINGS->ps_argvstr = "foo";])],
|
|
||||||
[pgac_cv_var_PS_STRINGS=yes],
|
|
||||||
[pgac_cv_var_PS_STRINGS=no])])
|
|
||||||
if test "$pgac_cv_var_PS_STRINGS" = yes ; then
|
|
||||||
AC_DEFINE([HAVE_PS_STRINGS], 1, [Define to 1 if the PS_STRINGS thing exists.])
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_REPLACE_FUNCS(m4_normalize([
|
AC_REPLACE_FUNCS(m4_normalize([
|
||||||
explicit_bzero
|
explicit_bzero
|
||||||
getopt
|
getopt
|
||||||
|
17
meson.build
17
meson.build
@ -2293,23 +2293,6 @@ endif
|
|||||||
cdata.set('pg_restrict', '__restrict')
|
cdata.set('pg_restrict', '__restrict')
|
||||||
|
|
||||||
|
|
||||||
if cc.links('''
|
|
||||||
#include <machine/vmparam.h>
|
|
||||||
#include <sys/exec.h>
|
|
||||||
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
PS_STRINGS->ps_nargvstr = 1;
|
|
||||||
PS_STRINGS->ps_argvstr = "foo";
|
|
||||||
}
|
|
||||||
''',
|
|
||||||
name: 'PS_STRINGS', args: test_c_args)
|
|
||||||
cdata.set('HAVE_PS_STRINGS', 1)
|
|
||||||
else
|
|
||||||
cdata.set('HAVE_PS_STRINGS', false)
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
# Most libraries are included only if they demonstrably provide a function we
|
# Most libraries are included only if they demonstrably provide a function we
|
||||||
# need, but libm is an exception: always include it, because there are too
|
# need, but libm is an exception: always include it, because there are too
|
||||||
# many compilers that play cute optimization games that will break probes for
|
# many compilers that play cute optimization games that will break probes for
|
||||||
|
@ -15,10 +15,6 @@
|
|||||||
#include "postgres.h"
|
#include "postgres.h"
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#ifdef HAVE_PS_STRINGS
|
|
||||||
#include <machine/vmparam.h> /* for old BSD */
|
|
||||||
#include <sys/exec.h>
|
|
||||||
#endif
|
|
||||||
#if defined(__darwin__)
|
#if defined(__darwin__)
|
||||||
#include <crt_externs.h>
|
#include <crt_externs.h>
|
||||||
#endif
|
#endif
|
||||||
@ -39,16 +35,10 @@ bool update_process_title = DEFAULT_UPDATE_PROCESS_TITLE;
|
|||||||
*
|
*
|
||||||
* PS_USE_SETPROCTITLE_FAST
|
* PS_USE_SETPROCTITLE_FAST
|
||||||
* use the function setproctitle_fast(const char *, ...)
|
* use the function setproctitle_fast(const char *, ...)
|
||||||
* (newer FreeBSD systems)
|
* (FreeBSD)
|
||||||
* PS_USE_SETPROCTITLE
|
* PS_USE_SETPROCTITLE
|
||||||
* use the function setproctitle(const char *, ...)
|
* use the function setproctitle(const char *, ...)
|
||||||
* (newer BSD systems)
|
* (other BSDs)
|
||||||
* 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)
|
|
||||||
* PS_USE_CLOBBER_ARGV
|
* PS_USE_CLOBBER_ARGV
|
||||||
* write over the argv and environment area
|
* write over the argv and environment area
|
||||||
* (Linux and most SysV-like systems)
|
* (Linux and most SysV-like systems)
|
||||||
@ -62,11 +52,7 @@ bool update_process_title = DEFAULT_UPDATE_PROCESS_TITLE;
|
|||||||
#define PS_USE_SETPROCTITLE_FAST
|
#define PS_USE_SETPROCTITLE_FAST
|
||||||
#elif defined(HAVE_SETPROCTITLE)
|
#elif defined(HAVE_SETPROCTITLE)
|
||||||
#define PS_USE_SETPROCTITLE
|
#define PS_USE_SETPROCTITLE
|
||||||
#elif defined(HAVE_PS_STRINGS)
|
#elif defined(__linux__) || defined(_AIX) || defined(__sun) || defined(__darwin__)
|
||||||
#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__)
|
|
||||||
#define PS_USE_CLOBBER_ARGV
|
#define PS_USE_CLOBBER_ARGV
|
||||||
#elif defined(WIN32)
|
#elif defined(WIN32)
|
||||||
#define PS_USE_WIN32
|
#define PS_USE_WIN32
|
||||||
@ -186,9 +172,6 @@ save_ps_display_args(int argc, char **argv)
|
|||||||
new_environ[i] = NULL;
|
new_environ[i] = NULL;
|
||||||
environ = new_environ;
|
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
|
* 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__)
|
#if defined(__darwin__)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* macOS (and perhaps other NeXT-derived platforms?) has a static copy
|
* macOS has a static copy of the argv pointer, which we may fix like
|
||||||
* of the argv pointer, which we may fix like so:
|
* so:
|
||||||
*/
|
*/
|
||||||
*_NSGetArgv() = new_argv;
|
*_NSGetArgv() = new_argv;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
argv = new_argv;
|
argv = new_argv;
|
||||||
}
|
}
|
||||||
#endif /* PS_USE_CHANGE_ARGV or PS_USE_CLOBBER_ARGV */
|
#endif /* PS_USE_CLOBBER_ARGV */
|
||||||
|
|
||||||
return 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 is a pointer, it might still be null */
|
||||||
if (!ps_buffer)
|
if (!ps_buffer)
|
||||||
return;
|
return;
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/* make extra argv slots point at end_of_area (a NUL) */
|
||||||
* Overwrite argv[] to point at appropriate space, if needed
|
for (int i = 1; i < save_argc; i++)
|
||||||
*/
|
save_argv[i] = ps_buffer + ps_buffer_size;
|
||||||
|
|
||||||
#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;
|
|
||||||
}
|
|
||||||
#endif /* PS_USE_CLOBBER_ARGV */
|
#endif /* PS_USE_CLOBBER_ARGV */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -369,11 +337,6 @@ set_ps_display(const char *activity)
|
|||||||
setproctitle_fast("%s", ps_buffer);
|
setproctitle_fast("%s", ps_buffer);
|
||||||
#endif
|
#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
|
#ifdef PS_USE_CLOBBER_ARGV
|
||||||
/* pad unused memory; need only clobber remainder of old status string */
|
/* pad unused memory; need only clobber remainder of old status string */
|
||||||
if (last_status_len > ps_buffer_cur_len)
|
if (last_status_len > ps_buffer_cur_len)
|
||||||
|
@ -334,9 +334,6 @@
|
|||||||
/* Define to 1 if you have the `ppoll' function. */
|
/* Define to 1 if you have the `ppoll' function. */
|
||||||
#undef HAVE_PPOLL
|
#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. */
|
/* Define if you have POSIX threads libraries and header files. */
|
||||||
#undef HAVE_PTHREAD
|
#undef HAVE_PTHREAD
|
||||||
|
|
||||||
|
@ -308,7 +308,6 @@ sub GenerateFiles
|
|||||||
HAVE_POSIX_FADVISE => undef,
|
HAVE_POSIX_FADVISE => undef,
|
||||||
HAVE_POSIX_FALLOCATE => undef,
|
HAVE_POSIX_FALLOCATE => undef,
|
||||||
HAVE_PPOLL => undef,
|
HAVE_PPOLL => undef,
|
||||||
HAVE_PS_STRINGS => undef,
|
|
||||||
HAVE_PTHREAD => undef,
|
HAVE_PTHREAD => undef,
|
||||||
HAVE_PTHREAD_BARRIER_WAIT => undef,
|
HAVE_PTHREAD_BARRIER_WAIT => undef,
|
||||||
HAVE_PTHREAD_IS_THREADED_NP => undef,
|
HAVE_PTHREAD_IS_THREADED_NP => undef,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user