Coda Distributed File System
lwp_ucontext.h
Go to the documentation of this file.
1/* BLURB lgpl
2
3 Coda File System
4 Release 5
5
6 Copyright (c) 2005-2016 Carnegie Mellon University
7 Additional copyrights listed below
8
9This code is distributed "AS IS" without warranty of any kind under
10the terms of the GNU Library General Public Licence Version 2, as
11shown in the file LICENSE. The technical and financial contributors to
12Coda are listed in the file CREDITS.
13
14 Additional copyrights
15#*/
16
17#ifndef LWP_UCONTEXT_H
18#define LWP_UCONTEXT_H
19
20#ifdef HAVE_CONFIG_H
21#include <config.h>
22#endif
23
24#include <setjmp.h>
25#include <signal.h>
26#include "lwp_stacktrace.h"
27
28#ifdef SAVE_SIGMASK
29#define JMP_BUF sigjmp_buf
30#define SETJMP(x, y) sigsetjmp(x, y)
31#define LONGJMP(x) siglongjmp(x, 1)
32#else
33#define JMP_BUF jmp_buf
34#define SETJMP(x, y) setjmp(x)
35#define LONGJMP(x) longjmp(x, 1)
36#endif
37
42};
43
44/* SETJMP _has_ to be in a macro, because we can not call LONGJMP when we
45 * unwrap the stack, i.e. return from a 'lwp_getcontext' function. */
46#define lwp_getcontext(ucp) \
47 (memset((ucp), 0, sizeof(struct lwp_ucontext)), \
48 SETJMP((ucp)->uc_mcontext, 1))
49int lwp_setcontext(const struct lwp_ucontext *ucp);
50void lwp_makecontext(struct lwp_ucontext *ucp, void (*func)(void *), void *arg);
51int lwp_swapcontext(struct lwp_ucontext *oucp, const struct lwp_ucontext *ucp);
52
53#endif /* LWP_UCONTEXT_H */
int lwp_swapcontext(struct lwp_ucontext *oucp, const struct lwp_ucontext *ucp)
Definition: lwp_ucontext.c:107
int lwp_setcontext(const struct lwp_ucontext *ucp)
Definition: lwp_ucontext.c:101
void lwp_makecontext(struct lwp_ucontext *ucp, void(*func)(void *), void *arg)
Definition: lwp_ucontext.c:114
#define JMP_BUF
Definition: lwp_ucontext.h:33
Definition: rpc2.h:588
Definition: lwp_ucontext.h:38
JMP_BUF uc_mcontext
Definition: lwp_ucontext.h:41
struct lwp_ucontext * uc_link
Definition: lwp_ucontext.h:39
stack_t uc_stack
Definition: lwp_ucontext.h:40
Definition: lwp_stacktrace.h:29