mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 13:52:28 +00:00
Get fork() working on Windows
This is done without using Microsoft's internal APIs. MAP_PRIVATE mappings are copied to the subprocess via a pipe, since Microsoft doesn't want us to have proper COW pages. MAP_SHARED mappings are remapped without needing to do any copying. Global variables need copying along with the stack and the whole heap of anonymous mem. This actually improves the reliability of the redbean http server although one shouldn't expect 10k+ connections on a home computer that isn't running software built to serve like Linux or FreeBSD.
This commit is contained in:
parent
aea89fe832
commit
db33973e0a
105 changed files with 1476 additions and 912 deletions
|
@ -88,11 +88,6 @@ TEST(mmap, testMapFixed_destroysEverythingInItsPath) {
|
|||
MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0));
|
||||
ASSERT_GT(_mmi.i, m1);
|
||||
EXPECT_NE(-1, munmap((void *)kFixedmapStart, FRAMESIZE * 3));
|
||||
#ifdef __SANITIZE_ADDRESS__
|
||||
ASSERT_EQ(m1 + 1, _mmi.i);
|
||||
#else
|
||||
ASSERT_EQ(m1, _mmi.i);
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST(isheap, nullPtr) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue