This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to add 4K of scratch space at the bottom of the stack using C instead of C++?


> > Hi,
> > In order to dynamically load cygwin1.dll with VC, I need to add 4K of
> > scratch space at the bottom of my stack.
> >
> > The winsup/testsuite/cygload/cygload.cpp shows how to do it using C++.
> 
> I believe it's cygload.cc...
> 
> > How can I add the scratch space using C rather than C++ in a simplest
> > way?
> 
> I'm afraid it won't be very simple, but how about something like
> 
> int main(int ac, char *av[]) {
>     char padding[4096];
>     backup_lower_stack();
> 
>     ...
> 
>     restore_lower_stack();
>     return ...
> }
> 
> with backup_lower_stack() and restore_lower_stack() adapted from the
> cygwin::padding constructor and destructor, respectively (the vector can
> be replaced by a malloc'ed piece of memory).
> 
> However, you'll also need to write a C interface to cygwin::connector.
> Once you have this working, I would strongly urge you to submit the code
> to Cygwin.

By the way, the Makefile shows that the MSVC compiler is in 
C:/cygwin/usr/local/tools/i686_win32/vc7/Vc7. 
Is it a package that is provided by cygwin? Or is it the MSVC software 
that is installed in that directory?

Thanks 


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]