diff options
author | trasz <trasz@FreeBSD.org> | 2011-04-05 20:23:59 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2011-04-05 20:23:59 +0000 |
commit | 92bec9b84c91c81031aecc423fd62e9a9b27b631 (patch) | |
tree | ff083b539865dc2215b27827e89a3109487e5979 /sys/compat/linux | |
parent | fffd1b22a504ec96e5bf538ba769d4ea4f5c8ded (diff) | |
download | FreeBSD-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.c | 5 |
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; |