mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32: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
|
@ -195,6 +195,15 @@ TEST(system, exitStatusPreservedAfterSemiColon) {
|
|||
RestoreStdout();
|
||||
}
|
||||
|
||||
TEST(system, devStdout) {
|
||||
CaptureStdout();
|
||||
ASSERT_EQ(0, GETEXITSTATUS(system("echo sup >/dev/stdout")));
|
||||
char buf[16] = {0};
|
||||
ASSERT_EQ(4, read(pipefd[0], buf, 16));
|
||||
ASSERT_STREQ("sup\n", buf);
|
||||
RestoreStdout();
|
||||
}
|
||||
|
||||
TEST(system, globio) {
|
||||
char buf[9] = {0};
|
||||
CaptureStdout();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue