4 ms·
> So do Cygwin and/or MSYS emulate the fork() call on Windows? and if so, do you have any idea how that is done? Cygwin does some pretty horrific hacks to emul
by jmgao 11y ago
> So do Cygwin and/or MSYS emulate the fork() call on Windows? and if so, do you have any idea how that is done?
Cygwin does some pretty horrific hacks to emulate it. It basically creates a paused child running the same binary, fills in its memory, stores the register context of where it came from in a shared memory, and then resumes the child. The child on startup detects that it was forked, and then looks into shared memory to resume running at the place of the fork.
edit: It's even worse than I remembered: https://www.cygwin.com/faq.html#faq.api.fork https://www.cygwin.com/faq.html#faq.api.fork
- vram22 11y agoWow. That sure is complex.