Closed hoodmane closed 1 week ago
#include <fcntl.h> #include <errno.h> #include <string.h> #include <stdio.h> int main(void) { open("directory-that-does-not-exist/b", O_RDWR | O_CREAT | O_EXCL); printf("Error %d: %s\n", errno, strerror(errno)); }
$ gcc a.c $ ./a.out Error 20: Not a directory $ emcc a.c $ node a.out.js Error 44: No such file or directory
Emscripten should return ENOTDIR not ENOENT
ENOTDIR
ENOENT
Version of emscripten/emsdk:
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.72 (437140d149d9c977ffc8b09dbaf9b0f5a02db190) clang version 20.0.0git (https:/github.com/llvm/llvm-project 1c4caece05f1885ba6ed80755d6b5de1b9f99579) Target: wasm32-unknown-emscripten Thread model: posix
Okay well now I'm trying it again and getting Error 2: No such file or directory with gcc.
Error 2: No such file or directory
a.c:
Run it
Desired behavior
Emscripten should return
ENOTDIR
notENOENT
Version of emscripten/emsdk:
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.72 (437140d149d9c977ffc8b09dbaf9b0f5a02db190) clang version 20.0.0git (https:/github.com/llvm/llvm-project 1c4caece05f1885ba6ed80755d6b5de1b9f99579) Target: wasm32-unknown-emscripten Thread model: posix