MCPcopy Create free account
hub / github.com/apple-oss-distributions/dyld / getRealPath

Method getRealPath

cache_builder/BuilderFileSystem.cpp:261–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259//
260
261bool FileSystemMRM::getRealPath(const char possiblePath[MAXPATHLEN], char realPath[MAXPATHLEN]) const
262{
263 Diagnostics diag;
264 std::string resolvedPath = symlinkResolver.realPath(diag, possiblePath);
265 if (diag.hasError()) {
266 diag.verbose("MRM error: %s\n", diag.errorMessage().c_str());
267 diag.clearError();
268 return false;
269 }
270
271 // FIXME: Should we only return real paths of files which point to macho's? For now that is what we are doing
272 auto it = fileMap.find(resolvedPath);
273 if (it == fileMap.end())
274 return false;
275
276 memcpy(realPath, resolvedPath.c_str(), std::min((size_t)MAXPATHLEN, resolvedPath.size() + 1));
277 return true;
278}
279
280bool FileSystemMRM::loadFile(const char* path, dyld3::closure::LoadedFileInfo& info,
281 char realerPath[MAXPATHLEN], void (^error)(const char* format, ...)) const

Callers 4

categorizeInputsMethod · 0.45
verifySelfContainedMethod · 0.45
buildDylibJITLoadersFunction · 0.45

Calls 8

realPathMethod · 0.80
verboseMethod · 0.80
clearErrorMethod · 0.80
hasErrorMethod · 0.45
errorMessageMethod · 0.45
findMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected