/* Copyright (c) 2002-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "restrict-process-size.h"
#include <unistd.h>
{
i_fatal("setrlimit(RLIMIT_DATA, %llu): %m",
(unsigned long long)bytes);
}
#ifdef HAVE_RLIMIT_AS
i_fatal("setrlimit(RLIMIT_AS, %llu): %m",
(unsigned long long)bytes);
}
#endif
}
{
#ifdef HAVE_RLIMIT_NPROC
i_error("setrlimit(RLIMIT_NPROC, %llu): %m",
(unsigned long long)count);
}
#endif
}
{
#ifdef HAVE_SETRLIMIT
i_error("setrlimit(RLIMIT_NOFILE, %llu): %m",
(unsigned long long)count);
}
#endif
}
{
#ifdef HAVE_RLIMIT_AS
i_error("getrlimit(RLIMIT_AS): %m");
return -1;
}
#else
i_error("getrlimit(RLIMIT_DATA): %m");
return -1;
}
#endif
return 0;
}
{
#ifdef HAVE_RLIMIT_CORE
i_error("getrlimit(RLIMIT_CORE) failed: %m");
return -1;
}
return 0;
#else
return -1;
#endif
}
{
#ifdef HAVE_RLIMIT_NPROC
i_error("getrlimit(RLIMIT_NPROC) failed: %m");
return -1;
}
return 0;
#else
return -1;
#endif
}
{
i_error("getrlimit(RLIMIT_NOFILE) failed: %m");
return -1;
}
return 0;
}