diff options
author | dchagin <dchagin@FreeBSD.org> | 2011-01-26 20:03:58 +0000 |
---|---|---|
committer | dchagin <dchagin@FreeBSD.org> | 2011-01-26 20:03:58 +0000 |
commit | 1e124ec538abd89755a07370b3e298c5d4e275bc (patch) | |
tree | 11e55f54986e1fd2a80fd707f1d646272a4b9266 /sys/kern | |
parent | 0044f4e6eb992ee895bfd4d01fcd358a52ef2622 (diff) | |
download | FreeBSD-src-1e124ec538abd89755a07370b3e298c5d4e275bc.zip FreeBSD-src-1e124ec538abd89755a07370b3e298c5d4e275bc.tar.gz |
Add macro to test the sv_flags of any process. Change some places to test
the flags instead of explicit comparing with address of known sysentvec
structures.
MFC after: 1 month
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_jail.c | 4 | ||||
-rw-r--r-- | sys/kern/sys_process.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 093165b..335cd31 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -745,7 +745,7 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) } #ifdef COMPAT_FREEBSD32 - if (td->td_proc->p_sysent->sv_flags & SV_ILP32) { + if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { uint32_t hid32; error = vfs_copyopt(opts, "host.hostid", &hid32, sizeof(hid32)); @@ -1972,7 +1972,7 @@ kern_jail_get(struct thread *td, struct uio *optuio, int flags) if (error != 0 && error != ENOENT) goto done_deref; #ifdef COMPAT_FREEBSD32 - if (td->td_proc->p_sysent->sv_flags & SV_ILP32) { + if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { uint32_t hid32 = pr->pr_hostid; error = vfs_setopt(opts, "host.hostid", &hid32, sizeof(hid32)); diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index ee374c6..a7f280a 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -727,7 +727,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) * Set the wrap controls accordingly. */ if (SV_CURPROC_FLAG(SV_ILP32)) { - if (td2->td_proc->p_sysent->sv_flags & SV_ILP32) + if (SV_PROC_FLAG(td2->td_proc, SV_ILP32)) safe = 1; wrap32 = 1; } |