diff options
author | jake <jake@FreeBSD.org> | 2003-04-01 23:25:18 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2003-04-01 23:25:18 +0000 |
commit | ac9bc07ca9180456780c4e82536485b56171bc92 (patch) | |
tree | ba8fa139669808717654ad65afb1c942a7d3cc93 /sys/kern | |
parent | d8464b70a3ce9a508a7ec417289322ea1b69334f (diff) | |
download | FreeBSD-src-ac9bc07ca9180456780c4e82536485b56171bc92.zip FreeBSD-src-ac9bc07ca9180456780c4e82536485b56171bc92.tar.gz |
- Fix UC_COPY_SIZE. Adding up the size of structure fields doesn't take
alignment into account.
- Return EJUSTRETURN from set_context on success to avoid clobbering the
first 2 out registers with td_retval on sparc64.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_context.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/kern/kern_context.c b/sys/kern/kern_context.c index d1b657f..ffb3f95 100644 --- a/sys/kern/kern_context.c +++ b/sys/kern/kern_context.c @@ -44,8 +44,7 @@ * the machine context. The next field is uc_link; we want to * avoid destroying the link when copying out contexts. */ -#define UC_COPY_SIZE (sizeof(sigset_t) + sizeof(mcontext_t)) - +#define UC_COPY_SIZE offsetof(ucontext_t, uc_link) #ifndef _SYS_SYSPROTO_H_ struct getcontext_args { @@ -102,7 +101,7 @@ setcontext(struct thread *td, struct setcontext_args *uap) } } } - return (ret); + return (ret == 0 ? EJUSTRETURN : ret); } int @@ -130,5 +129,5 @@ swapcontext(struct thread *td, struct swapcontext_args *uap) } } } - return (ret); + return (ret == 0 ? EJUSTRETURN : ret); } |