This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Suggested improvement to cygload.cc
- From: <Eric dot Zurcher at csiro dot au>
- To: <cygwin at cygwin dot com>
- Date: Wed, 23 Dec 2009 15:47:03 +1100
- Subject: Suggested improvement to cygload.cc
Hi,
I've recently had need to dynamically load a Cygwin DLL into an non-Cygwin application. The FAQ entry for doing this and the associated sample application (/src/winsup/testsuite/winsup.api/cygload.cc) are both a bit out-of-date, though they still provided me with enough information to get this working correctly.
A useful modification to cygload.cc and cygload.h might be to replace the fixed size (currently 32768) used for "padding" with a dynamically determined value. The number of bytes needed can be obtained by making the call:
int padSize = cygwin_internal(CW_CYGTLS_PADSIZE);
Making use of this value might require a bit more inline assembler (that's the approach I'm using), rather than simply declaring a variable to chew up the stack space, but this might keep things from breaking if the padding size changes in future releases of cygwin1.dll.
I'm not sure who maintains this stuff, so I'm just posting this suggestion to the list, in the hope that someone can and will act upon it.
Thanks!
Eric Zurcher
CSIRO Plant Industry
Canberra, Australia
Eric.Zurcher@csiro.au
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple