diff options
Diffstat (limited to 'tests/unistd/unlink.c')
-rw-r--r-- | tests/unistd/unlink.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/unistd/unlink.c b/tests/unistd/unlink.c index f0a8f4dd..9f532325 100644 --- a/tests/unistd/unlink.c +++ b/tests/unistd/unlink.c @@ -7,6 +7,9 @@ #include <string.h> #include <unistd.h> #include <sys/stat.h> +#if EMSCRIPTEN +#include <emscripten.h> +#endif static void create_file(const char *path, const char *buffer, int mode) { int fd = open(path, O_WRONLY | O_CREAT | O_EXCL, mode); @@ -19,6 +22,15 @@ static void create_file(const char *path, const char *buffer, int mode) { } void setup() { + mkdir("working", 0777); +#if EMSCRIPTEN + EM_ASM( +#if NODEFS + FS.mount(NODEFS, { root: '.' }, 'working'); +#endif + ); +#endif + chdir("working"); create_file("file", "test", 0777); create_file("file1", "test", 0777); symlink("file1", "file1-link"); |