summaryrefslogtreecommitdiffstats
path: root/m4/rlimit.m4
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 17:36:47 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 17:36:47 +0000
commit0441d265f2bb9da249c7abf333f0f771fadb4ab5 (patch)
tree3f3789daa2f6db22da6e55e92bee0062a7d613fe /m4/rlimit.m4
parentInitial commit. (diff)
downloaddovecot-0441d265f2bb9da249c7abf333f0f771fadb4ab5.tar.xz
dovecot-0441d265f2bb9da249c7abf333f0f771fadb4ab5.zip
Adding upstream version 1:2.3.21+dfsg1.upstream/1%2.3.21+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'm4/rlimit.m4')
-rw-r--r--m4/rlimit.m465
1 files changed, 65 insertions, 0 deletions
diff --git a/m4/rlimit.m4 b/m4/rlimit.m4
new file mode 100644
index 0000000..9e652a4
--- /dev/null
+++ b/m4/rlimit.m4
@@ -0,0 +1,65 @@
+dnl * Do we have RLIMIT_AS?
+AC_DEFUN([DOVECOT_RLIMIT_AS], [
+ AC_CACHE_CHECK([whether RLIMIT_AS exists],i_cv_have_rlimit_as,[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <sys/resource.h>
+ ]], [[
+ struct rlimit r;
+ getrlimit(RLIMIT_AS, &r);
+ ]])],[
+ i_cv_have_rlimit_as=yes
+ ], [
+ i_cv_have_rlimit_as=no
+ ])
+ ])
+
+ if test $i_cv_have_rlimit_as = yes; then
+ AC_DEFINE(HAVE_RLIMIT_AS,, [Define if you have RLIMIT_AS for setrlimit()])
+ fi
+])
+
+dnl * Do we have RLIMIT_NPROC?
+AC_DEFUN([DOVECOT_RLIMIT_NPROC], [
+ AC_CACHE_CHECK([whether RLIMIT_NPROC exists],i_cv_have_rlimit_nproc,[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <sys/resource.h>
+ ]], [[
+ struct rlimit r;
+ getrlimit(RLIMIT_NPROC, &r);
+ ]])],[
+ i_cv_have_rlimit_nproc=yes
+ ],[
+ i_cv_have_rlimit_nproc=no
+ ])
+ ])
+
+ if test $i_cv_have_rlimit_nproc = yes; then
+ AC_DEFINE(HAVE_RLIMIT_NPROC,, [Define if you have RLIMIT_NPROC for setrlimit()])
+ fi
+])
+
+dnl * Do we have RLIMIT_CORE?
+AC_DEFUN([DOVECOT_RLIMIT_CORE], [
+ AC_CACHE_CHECK([whether RLIMIT_CORE exists],i_cv_have_rlimit_core,[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <sys/resource.h>
+ ]], [[
+ struct rlimit r;
+ getrlimit(RLIMIT_CORE, &r);
+ ]])],[
+ i_cv_have_rlimit_core=yes
+ ],[
+ i_cv_have_rlimit_core=no
+ ])
+ ])
+
+ if test $i_cv_have_rlimit_core = yes; then
+ AC_DEFINE(HAVE_RLIMIT_CORE,, [Define if you have RLIMIT_CORE for getrlimit()])
+ fi
+])