delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/11/12/03:10:47

From: vischne AT ibm DOT net
Subject: How about a _beginthread implementation of fork?
12 Nov 1997 03:10:47 -0800 :
Message-ID: <199711120808.IAA08724.cygnus.gnu-win32@out4.ibm.net>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com

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 AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019