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:
Justine Tunney 2021-03-08 10:07:02 -08:00
parent 816b0e1851
commit 0ad609268f
21 changed files with 260 additions and 117 deletions

View file

@ -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) {