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

Function mi_theap_realpath

system/lib/mimalloc/src/alloc.c:536–552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

534#endif
535
536mi_decl_nodiscard static mi_decl_restrict char* mi_theap_realpath(mi_theap_t* theap, const char* fname, char* resolved_name) mi_attr_noexcept {
537 // todo: use GetFullPathNameW to allow longer file names
538 char buf[PATH_MAX];
539 DWORD res = GetFullPathNameA(fname, PATH_MAX, (resolved_name == NULL ? buf : resolved_name), NULL);
540 if (res == 0) {
541 errno = GetLastError(); return NULL;
542 }
543 else if (res > PATH_MAX) {
544 errno = EINVAL; return NULL;
545 }
546 else if (resolved_name != NULL) {
547 return resolved_name;
548 }
549 else {
550 return mi_theap_strndup(theap, buf, PATH_MAX);
551 }
552}
553
554#else
555

Callers 2

mi_realpathFunction · 0.85
mi_heap_realpathFunction · 0.85

Calls 5

mi_theap_strndupFunction · 0.85
mi_path_maxFunction · 0.85
mi_zallocFunction · 0.85
mi_freeFunction · 0.85
realpathFunction · 0.50

Tested by

no test coverage detected