summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorThomas Munro2022-08-04 21:18:34 +0000
committerThomas Munro2022-08-04 21:18:34 +0000
commitbdb657edd6db1e471437d62f4642674a801ef32c (patch)
tree74ae928e3976d43b74af6c76f13255bd87a5e3ac /src/include
parentca1e85513e1c92afb80a74935cbbb6f7e4a3ccf9 (diff)
Remove configure probe and related tests for getrlimit.
getrlimit() is in SUSv2 and all targeted systems have it. Windows doesn't have it. We could just use #ifndef WIN32, but for a little more explanation about why we're making things conditional, let's retain the HAVE_GETRLIMIT macro. It's defined in port.h for Unix systems. On systems that have it, it's not necessary to test for RLIMIT_CORE, RLIMIT_STACK or RLIMIT_NOFILE macros, since SUSv2 requires those and all targeted systems have them. Also remove references to a pre-historic alternative spelling of RLIMIT_NOFILE, and coding that seemed to believe that Cygwin didn't have it. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/CA+hUKGJ3LHeP9w5Fgzdr4G8AnEtJ=z=p6hGDEm4qYGEUX5B6fQ@mail.gmail.com
Diffstat (limited to 'src/include')
-rw-r--r--src/include/pg_config.h.in3
-rw-r--r--src/include/port.h8
2 files changed, 8 insertions, 3 deletions
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index ab812bca891..93173d67c0b 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -229,9 +229,6 @@
/* Define to 1 if you have the `getpeerucred' function. */
#undef HAVE_GETPEERUCRED
-/* Define to 1 if you have the `getrlimit' function. */
-#undef HAVE_GETRLIMIT
-
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
diff --git a/src/include/port.h b/src/include/port.h
index 323df8f9ede..2c25498add5 100644
--- a/src/include/port.h
+++ b/src/include/port.h
@@ -519,4 +519,12 @@ extern char *wait_result_to_str(int exit_status);
extern bool wait_result_is_signal(int exit_status, int signum);
extern bool wait_result_is_any_signal(int exit_status, bool include_command_not_found);
+/*
+ * Interfaces that we assume all Unix system have. We retain individual macros
+ * for better documentation.
+ */
+#ifndef WIN32
+#define HAVE_GETRLIMIT 1
+#endif
+
#endif /* PG_PORT_H */