Fix linuxulator prlimit64(2) with pid == 0. This makes 'ulimit -a'
return something reasonable, and helps linux binaries which attempt to close all the files, eg apt(8). Reviewed by: emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20692
This commit is contained in:
parent
68c0df92bc
commit
f343e8b139
@ -2001,10 +2001,14 @@ linux_prlimit64(struct thread *td, struct linux_prlimit64_args *args)
|
||||
flags |= PGET_CANDEBUG;
|
||||
else
|
||||
flags |= PGET_CANSEE;
|
||||
error = pget(args->pid, flags, &p);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
|
||||
if (args->pid == 0) {
|
||||
p = td->td_proc;
|
||||
PHOLD(p);
|
||||
} else {
|
||||
error = pget(args->pid, flags, &p);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
}
|
||||
if (args->old != NULL) {
|
||||
PROC_LOCK(p);
|
||||
lim_rlimit_proc(p, which, &rlim);
|
||||
|
Loading…
x
Reference in New Issue
Block a user