* cygtls.h (_cygtls::inside_kernel): Move function declaration into _cygtls

class.
* exceptions.cc (_cygtls::inside_kernel): Move function definition into _cygtls
class.
* fhandler.cc (fhandler_base::wait_overlapped): Make return tri-state to detect
when there is a EINTR situation.  Add a pointer to a length parameter.  Move
GetOverlappedResult into this function.
(fhandler_base::read_overlapped): Accommodate above changes and loop if we
receive a restartable signal.
(fhandler_base::write_overlapped): Ditto.
* fhandler.h (fhandler_base::wait_overlapped): Reflect above changes.
* fhandler_fifo.cc (fhandler_fifo::wait): Ditto.
This commit is contained in:
Christopher Faylor
2007-07-29 05:22:05 +00:00
parent 81e98baf81
commit ee2984326b
6 changed files with 61 additions and 23 deletions

View File

@ -282,13 +282,13 @@ stackdump (DWORD ebp, int open_file, bool isexception)
i == 16 ? " (more stack frames may be present)" : "");
}
static bool
inside_kernel (CONTEXT *cx)
bool
_cygtls::inside_kernel (CONTEXT *cx)
{
int res;
MEMORY_BASIC_INFORMATION m;
if (!_my_tls.isinitialized ())
if (!isinitialized ())
return true;
memset (&m, 0, sizeof m);
@ -627,7 +627,7 @@ _cygtls::handle_exceptions (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT
error_code |= 1;
if (e->ExceptionInformation[0]) /* Write access */
error_code |= 2;
if (!inside_kernel (in)) /* User space */
if (!me.inside_kernel (in)) /* User space */
error_code |= 4;
klog (LOG_INFO, "%s[%d]: segfault at %08x rip %08x rsp %08x error %d",
__progname, myself->pid,