Remove configure probe for sys/resource.h and refactor.
Thomas Munro <tmunro@postgresql.org>
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
Files
| Path | Change | +/− |
|---|---|---|
| configure | modified | +7 −7 |
| configure.ac | modified | +1 −2 |
| src/backend/storage/file/fd.c | modified | +1 −3 |
| src/backend/tcop/postgres.c | modified | +2 −8 |
| src/bin/pgbench/pgbench.c | modified | +0 −2 |
| src/bin/pg_ctl/pg_ctl.c | modified | +2 −4 |
| src/include/pg_config.h.in | modified | +0 −3 |
| src/include/port/win32/sys/resource.h | added | +20 −0 |
| src/include/rusagestub.h | deleted | +0 −31 |
| src/include/utils/pg_rusage.h | modified | +1 −6 |
| src/port/win32getrusage.c (from src/port/getrusage.c) | renamed | +3 −8 |
| src/test/regress/pg_regress.c | modified | +2 −5 |
| src/tools/msvc/Mkvcbuild.pm | modified | +2 −1 |
| src/tools/msvc/Solution.pm | modified | +0 −1 |
| src/tools/pginclude/cpluspluscheck | modified | +1 −4 |
| src/tools/pginclude/headerscheck | modified | +0 −4 |
Discussion
- Cleaning up historical portability baggage 108 messages · 2022-07-10 → 2025-06-10