summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/swapcontext.c
diff options
context:
space:
mode:
authormini <mini@FreeBSD.org>2002-09-20 08:13:21 +0000
committermini <mini@FreeBSD.org>2002-09-20 08:13:21 +0000
commit691c400510e85b42c8a1257e3a0f1ac21df6381f (patch)
tree1eb7673b1d863fb5a538e0e6727f54d12c70f5ce /lib/libc/gen/swapcontext.c
parentd605f099664588b02e2f852b4de0c28eb97babdd (diff)
downloadFreeBSD-src-691c400510e85b42c8a1257e3a0f1ac21df6381f.zip
FreeBSD-src-691c400510e85b42c8a1257e3a0f1ac21df6381f.tar.gz
Don't peek into MD structures from MI code. The getcontext(3) and
setcontext(3) functions check the validify of the mcontext_t structs.
Diffstat (limited to 'lib/libc/gen/swapcontext.c')
-rw-r--r--lib/libc/gen/swapcontext.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/lib/libc/gen/swapcontext.c b/lib/libc/gen/swapcontext.c
index f6ba87f..c34cb23 100644
--- a/lib/libc/gen/swapcontext.c
+++ b/lib/libc/gen/swapcontext.c
@@ -36,23 +36,15 @@ __FBSDID("$FreeBSD$");
__weak_reference(__swapcontext, swapcontext);
-#warning "FIX __swapcontext on non i386 please!"
-
int
__swapcontext(ucontext_t *oucp, const ucontext_t *ucp)
{
int ret;
-#ifdef __i386__
- /* XXX PLEASE FIX! XXX */
- if ((oucp == NULL) ||
- (oucp->uc_mcontext.mc_len != sizeof(mcontext_t)) ||
- (ucp == NULL) ||
- (ucp->uc_mcontext.mc_len != sizeof(mcontext_t))) {
+ if ((oucp == NULL) || (ucp == NULL)) {
errno = EINVAL;
return (-1);
}
-#endif
oucp->uc_flags &= ~UCF_SWAPPED;
ret = getcontext(oucp);
if ((ret == 0) && !(oucp->uc_flags & UCF_SWAPPED)) {
OpenPOWER on IntegriCloud