diff options
author | tjr <tjr@FreeBSD.org> | 2003-02-20 04:18:42 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2003-02-20 04:18:42 +0000 |
commit | 569e9d1a868a053312375c90c3f0c7ab35d18e47 (patch) | |
tree | 28ed51036df7221547d852601de750f3a017c7e6 /sys/kern/kern_resource.c | |
parent | c812b91a675fc33d56c494228f512aef76f65480 (diff) | |
download | FreeBSD-src-569e9d1a868a053312375c90c3f0c7ab35d18e47.zip FreeBSD-src-569e9d1a868a053312375c90c3f0c7ab35d18e47.tar.gz |
Remove the PL_SHAREMOD flag from struct plimit, which could have been
used to share resource limits between rfork threads, but never was.
Removing it makes resource limit locking much simpler -- only the current
process can change the contents of the structure that p_limit points to.
Diffstat (limited to 'sys/kern/kern_resource.c')
-rw-r--r-- | sys/kern/kern_resource.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index 5b3920c..5dfbfd7 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -555,8 +555,7 @@ dosetrlimit(td, which, limp) return (error); if (limp->rlim_cur > limp->rlim_max) limp->rlim_cur = limp->rlim_max; - if (p->p_limit->p_refcnt > 1 && - (p->p_limit->p_lflags & PL_SHAREMOD) == 0) { + if (p->p_limit->p_refcnt > 1) { p->p_limit->p_refcnt--; p->p_limit = limcopy(p->p_limit); alimp = &p->p_rlimit[which]; @@ -828,7 +827,6 @@ limcopy(lim) MALLOC(copy, struct plimit *, sizeof(struct plimit), M_SUBPROC, M_WAITOK); bcopy(lim->pl_rlimit, copy->pl_rlimit, sizeof(struct plimit)); - copy->p_lflags = 0; copy->p_refcnt = 1; return (copy); } |