Improve docs of more system calls

This change also found a few POSIX compliance bugs with errnos. Another
bug was discovered where, on Windows, pread() and pwrite() could modify
the file position in cases where ReadFile() returned an error e.g. when
seeking past the end of file. We also have more tests!
This commit is contained in:
Justine Tunney 2022-10-02 22:14:33 -07:00
parent af24c19db3
commit ccbae7799e
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
39 changed files with 589 additions and 175 deletions

View file

@ -25,12 +25,12 @@
//
// This is the same as fork() except it's optimized for the case
// where the caller invokes execve() immediately afterwards. You
// can also call functions like close(), dup2(), etc. You cannot
// call read() safely but you can call pread(). Call _exit() but
// don't call exit(). Look for the vforksafe function annotation
// can also call functions like close(), dup2(), etc. Call _exit
// but don't call exit. Look for vforksafe function annotations.
//
// Do not make the assumption that the parent is suspended until
// the child terminates since this impl calls fork() on Windows.
// the child terminates since this impl calls fork() on Windows,
// OpenBSD, and MacOS.
//
// @return pid of child process or 0 if forked process
// @returnstwice