summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2011-04-05 20:23:59 +0000
committertrasz <trasz@FreeBSD.org>2011-04-05 20:23:59 +0000
commit92bec9b84c91c81031aecc423fd62e9a9b27b631 (patch)
treeff083b539865dc2215b27827e89a3109487e5979 /sys/compat/linux
parentfffd1b22a504ec96e5bf538ba769d4ea4f5c8ded (diff)
downloadFreeBSD-src-92bec9b84c91c81031aecc423fd62e9a9b27b631.zip
FreeBSD-src-92bec9b84c91c81031aecc423fd62e9a9b27b631.tar.gz
Add accounting for most of the memory-related resources.
Sponsored by: The FreeBSD Foundation Reviewed by: kib (earlier version)
Diffstat (limited to 'sys/compat/linux')
-rw-r--r--sys/compat/linux/linux_misc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index 7b261d6..bbc805d 100644
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$");
#include <sys/priv.h>
#include <sys/proc.h>
#include <sys/reboot.h>
+#include <sys/racct.h>
#include <sys/resourcevar.h>
#include <sys/sched.h>
#include <sys/signalvar.h>
@@ -357,7 +358,9 @@ linux_uselib(struct thread *td, struct linux_uselib_args *args)
*/
PROC_LOCK(td->td_proc);
if (a_out->a_text > maxtsiz ||
- a_out->a_data + bss_size > lim_cur(td->td_proc, RLIMIT_DATA)) {
+ a_out->a_data + bss_size > lim_cur(td->td_proc, RLIMIT_DATA) ||
+ racct_set(td->td_proc, RACCT_DATA, a_out->a_data +
+ bss_size) != 0) {
PROC_UNLOCK(td->td_proc);
error = ENOMEM;
goto cleanup;
OpenPOWER on IntegriCloud