]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
ifdef RLIMIT_AS in recently added check 487/head
authorStuart Henderson <sthen@users.noreply.github.com>
Sat, 8 May 2021 15:12:39 +0000 (15:12 +0000)
committerGitHub <noreply@github.com>
Sat, 8 May 2021 15:12:39 +0000 (15:12 +0000)
Some OS still don't have RLIMIT_AS

daemon/unbound.c

index b2bb526c05acd606eb5250ac0fe1aa484eaea8b0..78771dbddfc938615c4a50be90e23c7c90b6b6a3 100644 (file)
@@ -212,12 +212,14 @@ checkrlimits(struct config_file* cfg)
        }
 #endif
 
+#ifdef RLIMIT_AS
        if(getrlimit(RLIMIT_AS, &rlim) == 0) {
                if(rlim.rlim_cur != (rlim_t)RLIM_INFINITY &&
                        rlim.rlim_cur < (rlim_t)memsize_expect) {
                        log_warn("the ulimit(max memory size) is smaller than the expected memory usage (added size of caches). %u < %u bytes", (unsigned)rlim.rlim_cur, (unsigned)memsize_expect);
                }
        }
+#endif
        if(getrlimit(RLIMIT_DATA, &rlim) == 0) {
                if(rlim.rlim_cur != (rlim_t)RLIM_INFINITY &&
                        rlim.rlim_cur < memsize_expect) {