From d89cc269039817729020bb6092efccd5bf520cd4 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Mon, 30 Mar 2015 20:56:03 +0100 Subject: Add cygwin_internal() operation to retrieve the EXCEPTION_RECORD from a siginfo_t * * external.cc (cygwin_internal): Add operation to retrieve a copy of the EXCEPTION_RECORD from a siginfo_t *. * include/sys/cygwin.h (cygwin_getinfo_types): Ditto. * exception.h (cygwin_exception): Add exception_record accessor. Signed-off-by: Jon TURNEY --- winsup/cygwin/external.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'winsup/cygwin/external.cc') diff --git a/winsup/cygwin/external.cc b/winsup/cygwin/external.cc index 5fac4bb..e379df1 100644 --- a/winsup/cygwin/external.cc +++ b/winsup/cygwin/external.cc @@ -27,6 +27,7 @@ details. */ #include "environ.h" #include "cygserver_setpwd.h" #include "pwdgrp.h" +#include "exception.h" #include #include #include @@ -688,6 +689,19 @@ cygwin_internal (cygwin_getinfo_types t, ...) res = 0; break; + case CW_EXCEPTION_RECORD_FROM_SIGINFO_T: + { + siginfo_t *si = va_arg(arg, siginfo_t *); + EXCEPTION_RECORD *er = va_arg(arg, EXCEPTION_RECORD *); + if (si && si->si_cyg && er) + { + memcpy(er, ((cygwin_exception *)si->si_cyg)->exception_record(), + sizeof(EXCEPTION_RECORD)); + res = 0; + } + } + break; + default: set_errno (ENOSYS); } -- cgit v1.1