Get Redbean fork() working on the New Technology

Now that we have understandable system call tracing on Windows, this
change rewrites many of the polyfill internals for that platform, to
help things get closer to tip top shape. Support for complex forking
scenarios had been in a regressed state for quite some time. Now, it
works! Subsequent changes should be able to address the performance.
This commit is contained in:
Justine Tunney 2022-03-20 08:01:14 -07:00
parent efedef6e65
commit 0cb6b6ff4b
84 changed files with 1340 additions and 338 deletions

View file

@ -8,6 +8,7 @@ extern const unsigned O_ACCMODE;
extern const unsigned O_APPEND;
extern const unsigned O_ASYNC;
extern const unsigned O_CLOEXEC;
extern const unsigned O_COMPRESSED;
extern const unsigned O_CREAT;
extern const unsigned O_DIRECT;
extern const unsigned O_DIRECTORY;
@ -15,6 +16,7 @@ extern const unsigned O_DSYNC;
extern const unsigned O_EXCL;
extern const unsigned O_EXEC;
extern const unsigned O_EXLOCK;
extern const unsigned O_INDEXED;
extern const unsigned O_LARGEFILE;
extern const unsigned O_NDELAY;
extern const unsigned O_NOATIME;
@ -41,10 +43,15 @@ extern const unsigned O_WRONLY;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define O_ACCMODE SYMBOLIC(O_ACCMODE)
#define O_RDONLY LITERALLY(0)
#define O_WRONLY LITERALLY(1)
#define O_RDWR LITERALLY(2)
#define O_ACCMODE LITERALLY(3)
#define O_APPEND SYMBOLIC(O_APPEND)
#define O_ASYNC SYMBOLIC(O_ASYNC)
#define O_CLOEXEC SYMBOLIC(O_CLOEXEC)
#define O_COMPRESSED SYMBOLIC(O_COMPRESSED)
#define O_CREAT SYMBOLIC(O_CREAT)
#define O_DIRECT SYMBOLIC(O_DIRECT)
#define O_DIRECTORY SYMBOLIC(O_DIRECTORY)
@ -52,6 +59,7 @@ COSMOPOLITAN_C_END_
#define O_EXCL SYMBOLIC(O_EXCL)
#define O_EXEC SYMBOLIC(O_EXEC)
#define O_EXLOCK SYMBOLIC(O_EXLOCK)
#define O_INDEXED SYMBOLIC(O_INDEXED)
#define O_LARGEFILE SYMBOLIC(O_LARGEFILE)
#define O_NDELAY SYMBOLIC(O_NDELAY)
#define O_NOATIME SYMBOLIC(O_NOATIME)
@ -61,8 +69,6 @@ COSMOPOLITAN_C_END_
#define O_NONBLOCK SYMBOLIC(O_NONBLOCK)
#define O_PATH SYMBOLIC(O_PATH)
#define O_RANDOM SYMBOLIC(O_RANDOM)
#define O_RDONLY SYMBOLIC(O_RDONLY)
#define O_RDWR SYMBOLIC(O_RDWR)
#define O_RSYNC SYMBOLIC(O_RSYNC)
#define O_SEARCH SYMBOLIC(O_SEARCH)
#define O_SEQUENTIAL SYMBOLIC(O_SEQUENTIAL)
@ -73,6 +79,5 @@ COSMOPOLITAN_C_END_
#define O_TRUNC SYMBOLIC(O_TRUNC)
#define O_TTY_INIT SYMBOLIC(O_TTY_INIT)
#define O_VERIFY SYMBOLIC(O_VERIFY)
#define O_WRONLY SYMBOLIC(O_WRONLY)
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_O_H_ */