We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Considering the following:
#include <fcntl.h> #include <string.h> #include <stdio.h> #include <assert.h> #include <unistd.h> static void create_file(const char *path, const char *buffer, int mode) { int fd = open(path, O_WRONLY | O_CREAT | O_EXCL, mode); assert(fd >= 0); int err = write(fd, buffer, sizeof(char) * strlen(buffer)); assert(err == (sizeof(char) * strlen(buffer))); close(fd); } int main() { char buf[20]; create_file("symlink_target", "xyz", 0777); symlink("symlink_target", "symlink_src"); readlink("symlink_src", buf, 20); printf("buf: '%s'\n", buf); unlink("symlink_src"); unlink("symlink_target"); }
Running with gcc we just the contents of the link vs running with emcc we get a fully qualified path:
gcc
emcc
$ gcc a.c $ ./a.out buf: 'symlink_target' $ emcc a.c $ node a.out.js buf: '/symlink_target'
Note the initial / in the emcc run.
/
The text was updated successfully, but these errors were encountered:
Actually the one call site of readlink in the Emscripten source code doesn't seem to expect this behavior since it immediately calls resolve: https://github.com/emscripten-core/emscripten/blob/main/src/library_fs.js?plain=1#L217-L218
resolve
Sorry, something went wrong.
8da8cb1
Successfully merging a pull request may close this issue.
Considering the following:
Running with
gcc
we just the contents of the link vs running withemcc
we get a fully qualified path:Note the initial
/
in the emcc run.The text was updated successfully, but these errors were encountered: