mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 06:48:31 +00:00
Rewrite special file handling on Windows
This change gets GNU grep working. What caused it to not work, is it wouldn't write to an output file descriptor when its dev/ino equaled /dev/null's. So now we invent special dev/ino values for these files
This commit is contained in:
parent
aca2261cda
commit
2db2f40a98
53 changed files with 485 additions and 299 deletions
|
@ -27,11 +27,9 @@
|
|||
int sys_openat(int dirfd, const char *file, int flags, unsigned mode) {
|
||||
static bool once, modernize;
|
||||
int d, e, f;
|
||||
/*
|
||||
* RHEL5 doesn't support O_CLOEXEC. It's hard to test for this.
|
||||
* Sometimes the system call succeeds and it just doesn't set the
|
||||
* flag. Other times, it return -530 which makes no sense.
|
||||
*/
|
||||
// RHEL5 doesn't support O_CLOEXEC. It's hard to test for this.
|
||||
// Sometimes the system call succeeds and it just doesn't set the
|
||||
// flag. Other times, it return -530 which makes no sense.
|
||||
if (!IsLinux() || !(flags & O_CLOEXEC) || modernize) {
|
||||
d = __sys_openat(dirfd, file, flags, mode);
|
||||
} else if (once) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue