summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/miscfuncs.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/miscfuncs.cc')
-rw-r--r--winsup/cygwin/miscfuncs.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/winsup/cygwin/miscfuncs.cc b/winsup/cygwin/miscfuncs.cc
index 001461620..2d3f52c3a 100644
--- a/winsup/cygwin/miscfuncs.cc
+++ b/winsup/cygwin/miscfuncs.cc
@@ -1,7 +1,7 @@
/* miscfuncs.cc: misc funcs that don't belong anywhere else
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc.
+ 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -433,6 +433,15 @@ slashify (const char *src, char *dst, bool trailing_slash_p)
*dst++ = 0;
}
+/* Return an address from the import jmp table of main program. */
+void * __attribute__ ((regparm (1)))
+__import_address (void *imp)
+{
+ const char *ptr = (const char *) imp;
+ const uintptr_t *jmpto = (uintptr_t *) *((uintptr_t *) (ptr + 2));
+ return (void *) *jmpto;
+}
+
/* CygwinCreateThread.
Replacement function for CreateThread. What we do here is to remove
@@ -448,7 +457,7 @@ struct thread_wrapper_arg
PBYTE stacklimit;
};
-DWORD WINAPI
+static DWORD WINAPI
thread_wrapper (VOID *arg)
{
/* Just plain paranoia. */