mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-10-09 06:08:23 +00:00
Improve system call polyfills
- Polyfill open() w/ O_CLOEXEC on RHEL5 - Remove old workaround from rmdir() on the New Technology - preadv() and pwritev() are now smarter about demodernization - preadv() and pwritev() are now available on the New Technology
This commit is contained in:
parent
816b0e1851
commit
0ad609268f
21 changed files with 260 additions and 117 deletions
|
@ -66,8 +66,7 @@ int posix_spawn(int *pid, const char *path,
|
|||
}
|
||||
}
|
||||
if (file_actions) {
|
||||
p = *file_actions;
|
||||
while (*p != '\0') {
|
||||
for (p = *file_actions; *p; p = strchr(p, ')') + 1) {
|
||||
if (!strncmp(p, "close(", 6)) {
|
||||
if (sscanf(p + 6, "%d)", &fd) != 1) _exit(127);
|
||||
if (close(fd) == -1) _exit(127);
|
||||
|
@ -92,7 +91,6 @@ int posix_spawn(int *pid, const char *path,
|
|||
} else {
|
||||
_exit(127);
|
||||
}
|
||||
p = strchr(p, ')') + 1;
|
||||
}
|
||||
}
|
||||
if (attrp) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue