diff options
author | Thomas Munro <tmunro@postgresql.org> | 2022-08-13 23:35:24 +1200 |
---|---|---|
committer | Thomas Munro <tmunro@postgresql.org> | 2022-08-14 00:09:47 +1200 |
commit | 36b3d52459aecd4f8bc39a4604e42186c48aa9d2 (patch) | |
tree | 15a7b1211cac9a9fcb193e3eb4984cbe73cb1b8a /src/bin | |
parent | 37a65d1db14658bc75faa3aea7bd5a064118d135 (diff) | |
download | postgresql-36b3d52459aecd4f8bc39a4604e42186c48aa9d2.tar.gz postgresql-36b3d52459aecd4f8bc39a4604e42186c48aa9d2.zip |
Remove configure probe for sys/resource.h and refactor.
<sys/resource.h> is in SUSv2 and is on all targeted Unix systems. We
have a replacement for getrusage() on Windows, so let's just move its
declarations into src/include/port/win32/sys/resource.h so that we can
use a standard-looking #include. Also remove an obsolete reference to
CLK_TCK. Also rename src/port/getrusage.c to win32getrusage.c,
following the convention for Windows-only fallback code.
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CA%2BhUKG%2BL_3brvh%3D8e0BW_VfX9h7MtwgN%3DnFHP5o7X2oZucY9dg%40mail.gmail.com
Diffstat (limited to 'src/bin')
-rw-r--r-- | src/bin/pg_ctl/pg_ctl.c | 6 | ||||
-rw-r--r-- | src/bin/pgbench/pgbench.c | 2 |
2 files changed, 2 insertions, 6 deletions
diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c index 2762e8590d0..73e20081d1d 100644 --- a/src/bin/pg_ctl/pg_ctl.c +++ b/src/bin/pg_ctl/pg_ctl.c @@ -14,14 +14,12 @@ #include <fcntl.h> #include <signal.h> #include <time.h> +#include <sys/resource.h> #include <sys/stat.h> +#include <sys/time.h> #include <sys/wait.h> #include <unistd.h> -#ifdef HAVE_SYS_RESOURCE_H -#include <sys/time.h> -#include <sys/resource.h> -#endif #include "catalog/pg_control.h" #include "common/controldata_utils.h" diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c index 45606e944da..c0e907d4373 100644 --- a/src/bin/pgbench/pgbench.c +++ b/src/bin/pgbench/pgbench.c @@ -40,9 +40,7 @@ #include <signal.h> #include <time.h> #include <sys/time.h> -#ifdef HAVE_SYS_RESOURCE_H #include <sys/resource.h> /* for getrlimit */ -#endif /* For testing, PGBENCH_USE_SELECT can be defined to force use of that code */ #if defined(HAVE_PPOLL) && !defined(PGBENCH_USE_SELECT) |