diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:51:24 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:51:24 +0000 |
commit | f7548d6d28c313cf80e6f3ef89aed16a19815df1 (patch) | |
tree | a3f6f2a3f247293bee59ecd28e8cd8ceb6ca064a /src/lib/restrict-process-size.h | |
parent | Initial commit. (diff) | |
download | dovecot-upstream.tar.xz dovecot-upstream.zip |
Adding upstream version 1:2.3.19.1+dfsg1.upstream/1%2.3.19.1+dfsg1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/lib/restrict-process-size.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/lib/restrict-process-size.h b/src/lib/restrict-process-size.h new file mode 100644 index 0000000..35c323d --- /dev/null +++ b/src/lib/restrict-process-size.h @@ -0,0 +1,25 @@ +#ifndef RESTRICT_PROCESS_SIZE_H +#define RESTRICT_PROCESS_SIZE_H + +#include <sys/time.h> +#ifdef HAVE_SYS_RESOURCE_H +# include <sys/resource.h> +#endif + +/* Restrict max. process size. */ +void restrict_process_size(rlim_t bytes); +/* Restrict max. number of processes. */ +void restrict_process_count(rlim_t count); +/* Set fd limit to count. */ +void restrict_fd_limit(rlim_t count); + +/* Get the core dump size limit. Returns 0 if ok, -1 if lookup failed. */ +int restrict_get_core_limit(rlim_t *limit_r); +/* Get the process VSZ size limit. Returns 0 if ok, -1 if lookup failed. */ +int restrict_get_process_size(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 |