This repository has been archived by the owner on Oct 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds support for resolving symlinks during path resolution. This commit also ports all of the remaining tests from nodejs/node#27850, with the 'poll' test currently disabled.
- Loading branch information
Showing
15 changed files
with
96 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
this file is part of the WASI tests. it exists outside of the sandbox, and | ||
should be inaccessible from the WASI tests. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../input.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
./loop2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
./loop1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../outside.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include <assert.h> | ||
#include <stdio.h> | ||
|
||
int main() { | ||
FILE* file = fopen("/sandbox/subdir/input_link.txt", "r"); | ||
assert(file != NULL); | ||
|
||
char c = fgetc(file); | ||
while (c != EOF) { | ||
int wrote = fputc(c, stdout); | ||
assert(wrote != EOF); | ||
c = fgetc(file); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include <assert.h> | ||
#include <poll.h> | ||
#include <time.h> | ||
#include <unistd.h> | ||
|
||
int main(void) { | ||
struct pollfd fds[2]; | ||
time_t before, now; | ||
int ret; | ||
|
||
fds[0] = (struct pollfd){.fd = 1, .events = POLLOUT, .revents = 0}; | ||
fds[1] = (struct pollfd){.fd = 2, .events = POLLOUT, .revents = 0}; | ||
|
||
ret = poll(fds, 2, -1); | ||
assert(ret == 2); | ||
assert(fds[0].revents == POLLOUT); | ||
assert(fds[1].revents == POLLOUT); | ||
|
||
fds[0] = (struct pollfd){.fd = 0, .events = POLLIN, .revents = 0}; | ||
time(&before); | ||
ret = poll(fds, 1, 2000); | ||
time(&now); | ||
assert(ret == 0); | ||
assert(now - before >= 2); | ||
|
||
sleep(1); | ||
time(&now); | ||
assert(now - before >= 3); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include <assert.h> | ||
#include <errno.h> | ||
#include <stdio.h> | ||
|
||
int main() { | ||
FILE* file = fopen("/sandbox/subdir/outside.txt", "r"); | ||
assert(file == NULL); | ||
assert(errno == ENOTCAPABLE); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include <assert.h> | ||
#include <errno.h> | ||
#include <stdio.h> | ||
|
||
int main() { | ||
FILE* file = fopen("/sandbox/subdir/loop1", "r"); | ||
assert(file == NULL); | ||
assert(errno == ELOOP); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.