1*8fdd01b3Smrg /* $NetBSD: ucontext.h,v 1.11 2018/02/04 01:13:45 mrg Exp $ */ 2c62a74e6Sthorpej 3c62a74e6Sthorpej /*- 4c62a74e6Sthorpej * Copyright (c) 1999 The NetBSD Foundation, Inc. 5c62a74e6Sthorpej * All rights reserved. 6c62a74e6Sthorpej * 7c62a74e6Sthorpej * This code is derived from software contributed to The NetBSD Foundation 8c62a74e6Sthorpej * by Klaus Klein. 9c62a74e6Sthorpej * 10c62a74e6Sthorpej * Redistribution and use in source and binary forms, with or without 11c62a74e6Sthorpej * modification, are permitted provided that the following conditions 12c62a74e6Sthorpej * are met: 13c62a74e6Sthorpej * 1. Redistributions of source code must retain the above copyright 14c62a74e6Sthorpej * notice, this list of conditions and the following disclaimer. 15c62a74e6Sthorpej * 2. Redistributions in binary form must reproduce the above copyright 16c62a74e6Sthorpej * notice, this list of conditions and the following disclaimer in the 17c62a74e6Sthorpej * documentation and/or other materials provided with the distribution. 18c62a74e6Sthorpej * 19c62a74e6Sthorpej * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20c62a74e6Sthorpej * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21c62a74e6Sthorpej * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22c62a74e6Sthorpej * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23c62a74e6Sthorpej * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24c62a74e6Sthorpej * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25c62a74e6Sthorpej * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26c62a74e6Sthorpej * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27c62a74e6Sthorpej * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28c62a74e6Sthorpej * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29c62a74e6Sthorpej * POSSIBILITY OF SUCH DAMAGE. 30c62a74e6Sthorpej */ 31c62a74e6Sthorpej 32c62a74e6Sthorpej #ifndef _UCONTEXT_H_ 33c62a74e6Sthorpej #define _UCONTEXT_H_ 34c62a74e6Sthorpej 35c62a74e6Sthorpej #include <sys/cdefs.h> 36c62a74e6Sthorpej #include <sys/ucontext.h> 37c62a74e6Sthorpej 38c62a74e6Sthorpej __BEGIN_DECLS 390b50389aSjoerg int getcontext(ucontext_t *) __returns_twice; 40c62a74e6Sthorpej int setcontext(const ucontext_t *); 419279f94bSchristos 429279f94bSchristos #pragma GCC diagnostic push 43*8fdd01b3Smrg #ifndef __cplusplus 449279f94bSchristos #pragma GCC diagnostic ignored "-Wstrict-prototypes" 45*8fdd01b3Smrg #endif 46d6424c53Sreinoud void makecontext(ucontext_t *, void (*)(), int, ...); 479279f94bSchristos #pragma GCC diagnostic pop 489279f94bSchristos 49fb7df618Skleink int swapcontext(ucontext_t * __restrict, const ucontext_t * __restrict); 50c62a74e6Sthorpej __END_DECLS 51c62a74e6Sthorpej 52c62a74e6Sthorpej #endif /* !_UCONTEXT_H_ */ 53