[dovecot] RLIMIT_AS patch for FreeBSD
Hey,
I've just updated the FreeBSD dovecot port to the 0.99.4 beta release,
the following patch was needed as FreeBSD has setrlimit(2) but does not
define RLIMIT_AS (I believe). I switched the code the require both,
alternatively find a parallel option in the FreeBSD setrlimit(2) manual
page. ( http://www.freebsd.org/cgi/man.cgi?setrlimit )
You may be interested in integrating this patch.
--- src/lib/restrict-process-size.c Fri Dec 27 18:19:41 2002
+++ src/lib/restrict-process-size.c-new Fri Dec 27 18:19:22 2002
@@ -32,7 +32,8 @@
void restrict_process_size(unsigned int size __attr_unused__)
{
-#ifdef HAVE_SETRLIMIT
+#if defined(HAVE_SETRLIMIT) && defined(RLIMIT_AS)
+/* FreeBSD has setrlimit(2) but does not define RLIMIT_AS */
struct rlimit rlim;
rlim.rlim_max = rlim.rlim_cur =
Thanks,
--
Dominic
<dom at cus.org.uk>
On Fri, 2002-12-27 at 20:31, Dominic Marks wrote:
I've just updated the FreeBSD dovecot port to the 0.99.4 beta release, the following patch was needed as FreeBSD has setrlimit(2) but does not define RLIMIT_AS (I believe).
I fixed this some time ago by using RLIMIT_DATA which should be defined everywhere. RLIMIT_AS is also used with systems that have it. It's mostly useful with Linux/glibc2.3 where RLIMIT_DATA doesn't have much effect since malloc() uses mmap() for larger allocations.
0.99.5 should be out soon I think :)
participants (2)
-
Dominic Marks
-
Timo Sirainen