Implement getcontext, setcontext, makecontext, swapcontext

* common.din (getcontext): Export.
        (makecontext): Export.
        (setcontext): Export.
        (swapcontext): Export.
        * exceptions.cc (__unwind_single_frame): New static functions, 64 bit
        only.
        (setcontext): New function.
        (getcontext): New function.
        (swapcontext): New function.
        (__cont_link_context): New function.
        (makecontext): New function.
        * include/cygwin/version.h (CYGWIN_VERSION_DLL_MAJOR): Bump to 2002.
        (CYGWIN_VERSION_API_MINOR): Bump.
        * include/ucontext.h (getcontext): Add prototype.
        (setcontext): Ditto.
        (swapcontext): Ditto.
        (makecontext): Ditto.
        * ntdll.h (NtContinue): Ditto.

        * new-features.xml (ov-new2.2): Add new section.  Document getcontext,
        setcontext, makecontext, swapcontext.
        * posix.xml (std-deprec): Add getcontext, setcontext, makecontext,
        swapcontext.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2015-07-17 14:31:12 +02:00
parent 9a69aac0ed
commit 1020bb292a
10 changed files with 301 additions and 2 deletions

View File

@ -11,6 +11,18 @@ details. */
#ifndef _UCONTEXT_H
#define _UCONTEXT_H
#include <sys/cdefs.h>
#include <sys/ucontext.h>
__BEGIN_DECLS
extern int getcontext (ucontext_t *) __attribute__((__nonnull__));
extern int setcontext (const ucontext_t *) __attribute__((__nonnull__));
extern int swapcontext (ucontext_t *, const ucontext_t *)
__attribute__((__nonnull__));
extern void makecontext (ucontext_t *, void (*) (void), int, ...)
__attribute__((__nonnull__ (1)));
__END_DECLS
#endif /* _UCONTEXT_H */