This is the mail archive of the cygwin@sourceware.cygnus.com 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]

How about a _beginthread implementation of fork?


This is probably a naive approach, but is the following code an accurate
representation of how to implement fork() using the Windows 95 RTL C
library?  If so, how much effort would be needed to redo cygwin.dll so as
to make fork() _not_ do anything to the cygwin environment?

#include <stddef.h>
#include <process.h>

void __forker__(void *);
unsigned long fork ()
{
/* Possible code for getting the return address of the fork() caller: */
	return _beginthread((_USERENTRY (*)(void *))forker,
			4096, (void *)NULL);
}

void __forker__ (void *threadno)
{
/* Possible code for inserting the return address of the fork() caller: */
	return 0;
}


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


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