Mail Archives: cygwin/1997/11/19/07:55:54
Actually, the trick to simulating fork() under Windows is to program a
multi-threaded version of <setjmp.h> in which `longjmp(env, rval)' keeps
the stack of the thread calling it, copying any things necessary to
simulate the longjmp calling environment onto that stack.
This is because the Windows version of a thread involves a function, not a
region of code in a parent process. So, the `thread' function can't
return to the parent process. The best it can do is to longjmp back to
the code implementing fork().
Then, of course, a Windows process is an entire program and is created by
CreateProcess, which means that Linux getpid() has to be implemented as a
call to GetCurrentThreadID().
Come to think of it, wasn't it OS/2 that originally got us into this mess?
Windows 95/NT is just a belated OS/2 implementation.
-
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 -