/*1* Copyright (c) 2001 Daniel M. Eischen <[email protected]>2* Copyright (c) 2014 The FreeBSD Foundation.3* All rights reserved.4*5* Portions of this software were developed by Konstantin Belousov6* under sponsorship from the FreeBSD Foundation.7*8* Redistribution and use in source and binary forms, with or without9* modification, are permitted provided that the following conditions10* are met:11* 1. Redistributions of source code must retain the above copyright12* notice, this list of conditions and the following disclaimer.13* 2. Neither the name of the author nor the names of its contributors14* may be used to endorse or promote products derived from this software15* without specific prior written permission.16*17* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND18* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE19* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE20* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE21* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL22* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS23* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)24* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT25* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY26* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF27* SUCH DAMAGE.28*/2930#include <sys/param.h>31#include <sys/signal.h>32#include <sys/ucontext.h>33#include <errno.h>34#include <stddef.h>35#include "libc_private.h"3637__sym_compat(swapcontext, __impl_swapcontext, FBSD_1.0);38__weak_reference(swapcontext, __impl_swapcontext);39__sym_default(swapcontext, swapcontext, FBSD_1.2);4041#pragma weak swapcontext42int43swapcontext(ucontext_t *oucp, const ucontext_t *ucp)44{45return (INTERPOS_SYS(swapcontext, oucp, ucp));46}474849