From 36b3d52459aecd4f8bc39a4604e42186c48aa9d2 Mon Sep 17 00:00:00 2001 From: Thomas Munro Date: Sat, 13 Aug 2022 23:35:24 +1200 Subject: Remove configure probe for sys/resource.h and refactor. 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 Discussion: https://postgr.es/m/CA%2BhUKG%2BL_3brvh%3D8e0BW_VfX9h7MtwgN%3DnFHP5o7X2oZucY9dg%40mail.gmail.com --- src/backend/tcop/postgres.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/backend/tcop/postgres.c') diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 671edcb3c7a..7bec4e4ff58 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -23,16 +23,10 @@ #include #include #include +#include #include #include -#ifdef HAVE_SYS_RESOURCE_H #include -#include -#endif - -#ifdef WIN32 -#include "rusagestub.h" -#endif #include "access/parallel.h" #include "access/printtup.h" @@ -4860,7 +4854,7 @@ ShowUsage(const char *title) * The following rusage fields are not defined by POSIX, but they're * present on all current Unix-like systems so we use them without any * special checks. Some of these could be provided in our Windows - * emulation in src/port/getrusage.c with more work. + * emulation in src/port/win32getrusage.c with more work. */ appendStringInfo(&str, "!\t%ld kB max resident size\n", -- cgit v1.2.3