From: Alistair DOT McEwan AT comlab DOT ox DOT ac DOT uk (Alistair McEwan) Subject: fork() under win32 26 Jun 1997 00:29:48 -0700 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <199706260655.HAA09057.cygnus.gnu-win32@pine.comlab.ox.ac.uk> Original-To: gnu-win32 AT cygnus DOT com Original-Sender: owner-gnu-win32 AT cygnus DOT com Hi, I hope someone can help me! For various reasons, I have to produce two versions of the application I am writing - one which uses gnu-win32 and one which doesnt; and uses only Visual C++ tools. So my problem is this. The application is being ported from Unix (we have it running on a variety of flavours), and it relies _very_ heavily on the behaviour of fork(); ie I need to create a new process which is an *exact* copy of the calling process. The reason for this is that a number of things are set up by the parent which are necessary for the child to know - this includes shared memory segments et al. So essentially I need an exact copy, with all handles being inheritted, an exact copy of the address space, and execution in the child beginning at the point of the fork. (Hence I think it is precisely the behaviour of fork() which I need!) Although there is a fork in the cygwin library, I have been unable to find anything under VC++ which does this. It seems straightforward enough to launch another instance of the parent process (just relaunch the application, using CreateProcess()) which will inherit handles, but this doesnt seem to offer me the address space copy, and naturally execution begins at main(). Has anyone come across a problem like this before? Can anyone help? I am getting desperate! (I apologise for the slightly irrelevant nature of this to the list, but it has some slight relevance to gnbu-win32, I hope!) Ali -- ________________________________________________ Oxford University Computing Laboratory Alistair DOT McEwan AT comlab DOT ox DOT ac DOT uk +44 1865 273846 http://www.comlab.ox.ac.uk/oucl/people/alistair.mcewan.html ------------------------------------------------ - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".