[svn-commits] file: trunk r48591 - /trunk/res/res_limit.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Tue Dec 19 14:59:34 MST 2006


Author: file
Date: Tue Dec 19 15:59:33 2006
New Revision: 48591

URL: http://svn.digium.com/view/asterisk?view=rev&rev=48591
Log:
OpenBSD does not have RLIMIT_AS or RLIMIT_VMEM so until someone finds the right rlimit to use then let's not support the -v option on OpenBSD. (issue #8543 reported by jtodd)

Modified:
    trunk/res/res_limit.c

Modified: trunk/res/res_limit.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_limit.c?view=diff&rev=48591&r1=48590&r2=48591
==============================================================================
--- trunk/res/res_limit.c (original)
+++ trunk/res/res_limit.c Tue Dec 19 15:59:33 2006
@@ -25,6 +25,15 @@
 #include "asterisk/module.h"
 #include "asterisk/cli.h"
 
+/* Find proper rlimit for virtual memory */
+#ifdef RLIMIT_AS
+#define VMEM_DEF RLIMIT_AS
+#else
+#ifdef RLIMIT_VMEM
+#define VMEM_DEF RLIMIT_VMEM
+#endif
+#endif
+
 static struct limits {
 	int resource;
 	char limit[3];
@@ -41,10 +50,9 @@
 	{ RLIMIT_MEMLOCK, "-l", "amount of memory locked into RAM" },
 #endif
 	{ RLIMIT_NOFILE, "-n", "number of file descriptors" },
-#ifndef RLIMIT_AS	/* *BSD use RLIMIT_VMEM */
-#define	RLIMIT_AS	RLIMIT_VMEM
+#ifdef VMEM_DEF
+	{ VMEM_DEF, "-v", "virtual memory" },
 #endif
-	{ RLIMIT_AS, "-v", "virtual memory" },
 };
 
 static int str2limit(const char *string)
@@ -143,7 +151,9 @@
 "         -s  Process stack size [readonly]\n"
 "         -t  CPU usage [readonly]\n"
 "         -u  Child processes\n"
+#ifdef VMEM_DEF
 "         -v  Process virtual memory [readonly]\n"
+#endif
 "         -c  Core dump file size\n"
 "         -n  Number of file descriptors\n";
 



More information about the svn-commits mailing list