$OpenBSD: patch-logilab_common_proc_py,v 1.1 2016/04/27 12:02:52 shadchin Exp $

OpenBSD doesn't support RLIMIT_AS

--- logilab/common/proc.py.orig	Mon Oct 12 20:39:18 2015
+++ logilab/common/proc.py	Sun Oct 18 17:05:28 2015
@@ -30,7 +30,7 @@ __docformat__ = "restructuredtext en"
 
 import os
 import stat
-from resource import getrlimit, setrlimit, RLIMIT_CPU, RLIMIT_AS
+from resource import getrlimit, setrlimit, RLIMIT_CPU, RLIMIT_DATA
 from signal import signal, SIGXCPU, SIGKILL, SIGUSR2, SIGUSR1
 from threading import Timer, currentThread, Thread, Event
 from time import time
@@ -251,10 +251,10 @@ class ResourceController:
                 setrlimit(RLIMIT_CPU, cpu_limit)
             if self.max_memory is not None:
                 self._msentinel = MemorySentinel(1, int(self.max_memory) )
-                self._old_max_memory = getrlimit(RLIMIT_AS)
+                self._old_max_memory = getrlimit(RLIMIT_DATA)
                 self._old_usr1_hdlr = signal(SIGUSR1, self._hangle_sig_memory)
-                as_limit = (int(self.max_memory), self._old_max_memory[1])
-                setrlimit(RLIMIT_AS, as_limit)
+                data_limit = (int(self.max_memory), self._old_max_memory[1])
+                setrlimit(RLIMIT_DATA, data_limit)
                 self._msentinel.start()
         self._limit_set += 1
 
@@ -272,6 +272,6 @@ class ResourceController:
             if self.max_memory is not None:
                 self._msentinel.stop()
                 self._msentinel = None
-                setrlimit(RLIMIT_AS, self._old_max_memory)
+                setrlimit(RLIMIT_DATA, self._old_max_memory)
                 signal(SIGUSR1, self._old_usr1_hdlr)
         self._limit_set -= 1
