-
Notifications
You must be signed in to change notification settings - Fork 824
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
86 additions
and
12 deletions.
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
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,34 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <sys/stat.h> | ||
#include <sys/types.h> | ||
#include <unistd.h> | ||
|
||
// the difference between this test and the one in create-dir-at-cwd is the | ||
// presence of chdir. | ||
|
||
// this will force chdir to be linked with this binary which in turn will change | ||
// the behavior of rel_path logic the libc. | ||
// | ||
// for more info see: libc-find-relpath.h in wasix-libc | ||
int (*dummy_chdir_ref)(const char *path) = chdir; | ||
|
||
int main() { | ||
int status = EXIT_FAILURE; | ||
|
||
const char *dirName1 = "test1"; | ||
if (mkdir(dirName1, 0755) != 0) { | ||
goto end; | ||
} | ||
|
||
const char *dirName2 = "./test2"; | ||
if (mkdir(dirName2, 0755) != 0) { | ||
goto end; | ||
} | ||
|
||
status = EXIT_SUCCESS; | ||
|
||
end: | ||
printf("%d", status); | ||
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,5 @@ | ||
#!/bin/bash | ||
|
||
$WASMER -q run main.wasm --dir . > output | ||
|
||
rmdir test1 test2 2>/dev/null && printf "0" | diff -u output - 1>/dev/null |
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,24 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <sys/stat.h> | ||
#include <sys/types.h> | ||
|
||
int main() { | ||
int status = EXIT_FAILURE; | ||
|
||
const char *dirName1 = "test1"; | ||
if (mkdir(dirName1, 0755) != 0) { | ||
goto end; | ||
} | ||
|
||
const char *dirName2 = "./test2"; | ||
if (mkdir(dirName2, 0755) != 0) { | ||
goto end; | ||
} | ||
|
||
status = EXIT_SUCCESS; | ||
|
||
end: | ||
printf("%d", status); | ||
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,5 @@ | ||
#!/bin/bash | ||
|
||
$WASMER -q run main.wasm --dir . > output | ||
|
||
rmdir test1 test2 2>/dev/null && printf "0" | diff -u output - 1>/dev/null |