[Orc][LibResolver] Fix GNU/Hurd build (#184470)
GNU/Hurd does not put a PATH_MAX static constraint on path lengths. We can instead check the symlink length.
This commit is contained in:
parent
11e7a49a58
commit
9ce30c8dc3
@ -439,11 +439,9 @@ std::optional<std::string> PathResolver::readlinkCached(StringRef Path) {
|
||||
return Cache;
|
||||
|
||||
// If result not in cache - call system function and cache result
|
||||
char buf[PATH_MAX];
|
||||
ssize_t len;
|
||||
if ((len = readlink(Path.str().c_str(), buf, sizeof(buf))) != -1) {
|
||||
buf[len] = '\0';
|
||||
std::string s(buf);
|
||||
SmallString<128> Buf;
|
||||
if (!sys::fs::readlink(Path, Buf)) {
|
||||
std::string s(Buf.str());
|
||||
LibPathCache->insert_link(Path, s);
|
||||
return s;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user