MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / _wasmfs_readlink

Function _wasmfs_readlink

system/lib/wasmfs/js_api.cpp:143–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143int _wasmfs_readlink(const char* path, char** out_ptr) {
144 static thread_local char* readBuf = (char*)malloc(PATH_MAX);
145 int bytes = __syscall_readlinkat(AT_FDCWD, path, readBuf, PATH_MAX);
146 if (bytes < 0) {
147 return bytes;
148 }
149 readBuf[bytes] = '\0';
150 *out_ptr = readBuf;
151 return 0;
152}
153
154int _wasmfs_write(int fd, void* buf, size_t count) {
155 __wasi_ciovec_t iovs[1];

Callers

nothing calls this directly

Calls 2

__syscall_readlinkatFunction · 0.85
mallocFunction · 0.50

Tested by

no test coverage detected