my shitty toy implementation of POSIX-like fork() emulation on native Windows for fun and learning
mostly taken from cygwin code
to explore the possibilities...? idk
tested under MSYS2 MINGW64 environemnt, require mingw-w64-x86_64-gcc
and make
$ make
$ ./test.exe
before fork
in parent
in child
$
- x86
- x86_64
- arm32
- arm64
-
this is Non-Copy-On-Write (inspired by Cygwin and PW32), if you are looking for a CoW implementation maybe check midipix
-
currently doesn't support working with a real CRT (like msvcrt and ucrt), because they are not fork-aware
-
no support for dynamic linking, TLS and stuffs yet
-
currently support for heap and mmaped memory are not implemented
-
might have unknown impact on win32 objects
-
currently only implemented for console subsystem
-
currently only known to work within simple programs like this demo
-
LLD is not supported due to it lack of linker script support on PE/COFF
no log print for win32 api failures or so yet, but you can debug with API monitor and or by attaching GDB or x64dbg