return -1;
#endif
}
+
+int restrict_get_fd_limit(rlim_t *limit_r)
+{
+ struct rlimit rlim;
+
+ if (getrlimit(RLIMIT_NOFILE, &rlim) < 0) {
+ i_error("getrlimit(RLIMIT_NOFILE) failed: %m");
+ return -1;
+ }
+ *limit_r = rlim.rlim_cur;
+ return 0;
+}
int restrict_get_core_limit(rlim_t *limit_r);
/* Get the process count limit. Returns 0 if ok, -1 if lookup failed. */
int restrict_get_process_limit(rlim_t *limit_r);
+/* Get the fd limit. Returns 0 if ok, -1 if lookup failed. */
+int restrict_get_fd_limit(rlim_t *limit_r);
#endif