1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-17 17:02:08 +03:00

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
This commit is contained in:
Thomas Munro
2022-08-13 23:35:24 +12:00
parent 37a65d1db1
commit 36b3d52459
16 changed files with 42 additions and 89 deletions

View File

@ -23,16 +23,10 @@
#include <limits.h>
#include <signal.h>
#include <unistd.h>
#include <sys/resource.h>
#include <sys/select.h>
#include <sys/socket.h>
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/time.h>
#include <sys/resource.h>
#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",