- 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.
This commit is contained in:
Jake Burkholder 2003-04-01 23:25:18 +00:00
parent 6e1e13b5e0
commit fc2fca74d8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=112962

View File

@ -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);
}