On Dec 9 12:55, Benson Margulies wrote: > I assume that there's a very strong reason why this code can't just > allocate a stack any-old-place (calling VirtualAlloc with first arg 0) > and use it. What I don't understand is the nature of the constraints. If > the parent needs to know, why not have stack_base make a call to > VirtualAlloc with first arg 0 to allocate a brand-new region, on the > theory that such a region is a lot more likely to end up with a > corresponding hole in the child process?
Just an example: void foo() { int x = 1; int *xp = &x; if (!fork()) /* Child */ printf ("%d\n", *xp); } What happens if the stack of the child has been allocated at another address as the parent's stack? Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Developer mailto:[EMAIL PROTECTED] Red Hat, Inc. -- 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/