diff options
author | jhb <jhb@FreeBSD.org> | 2013-09-19 18:53:42 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2013-09-19 18:53:42 +0000 |
commit | d3ef75b6c79e9e6d642efa9c32a96524d7a5a5b7 (patch) | |
tree | 56c7a97f082d488a8b917c2d2d52956076373329 /sys/kern/kern_proc.c | |
parent | 8ecfe4666e7be9cea4cf6c3ef929de2e8d286f41 (diff) | |
download | FreeBSD-src-d3ef75b6c79e9e6d642efa9c32a96524d7a5a5b7.zip FreeBSD-src-d3ef75b6c79e9e6d642efa9c32a96524d7a5a5b7.tar.gz |
Extend the support for exempting processes from being killed when swap is
exhausted.
- Add a new protect(1) command that can be used to set or revoke protection
from arbitrary processes. Similar to ktrace it can apply a change to all
existing descendants of a process as well as future descendants.
- Add a new procctl(2) system call that provides a generic interface for
control operations on processes (as opposed to the debugger-specific
operations provided by ptrace(2)). procctl(2) uses a combination of
idtype_t and an id to identify the set of processes on which to operate
similar to wait6().
- Add a PROC_SPROTECT control operation to manage the protection status
of a set of processes. MADV_PROTECT still works for backwards
compatability.
- Add a p_flag2 to struct proc (and a corresponding ki_flag2 to kinfo_proc)
the first bit of which is used to track if P_PROTECT should be inherited
by new child processes.
Reviewed by: kib, jilles (earlier version)
Approved by: re (delphij)
MFC after: 1 month
Diffstat (limited to 'sys/kern/kern_proc.c')
-rw-r--r-- | sys/kern/kern_proc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 3fa7a7f..9968e76 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -802,6 +802,7 @@ fill_kinfo_proc_only(struct proc *p, struct kinfo_proc *kp) kp->ki_fd = p->p_fd; kp->ki_vmspace = p->p_vmspace; kp->ki_flag = p->p_flag; + kp->ki_flag2 = p->p_flag2; cred = p->p_ucred; if (cred) { kp->ki_uid = cred->cr_uid; @@ -1161,6 +1162,7 @@ freebsd32_kinfo_proc_out(const struct kinfo_proc *ki, struct kinfo_proc32 *ki32) bcopy(ki->ki_comm, ki32->ki_comm, COMMLEN + 1); bcopy(ki->ki_emul, ki32->ki_emul, KI_EMULNAMELEN + 1); bcopy(ki->ki_loginclass, ki32->ki_loginclass, LOGINCLASSLEN + 1); + CP(*ki, *ki32, ki_flag2); CP(*ki, *ki32, ki_fibnum); CP(*ki, *ki32, ki_cr_flags); CP(*ki, *ki32, ki_jid); |