MCPcopy Create free account
hub / github.com/awslabs/aws-lambda-cpp / read_symlink

Method read_symlink

src/backward.h:1332–1352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1330 }
1331
1332 static std::string read_symlink(std::string const& symlink_path)
1333 {
1334 std::string path;
1335 path.resize(100);
1336
1337 while (true) {
1338 ssize_t len = ::readlink(symlink_path.c_str(), &*path.begin(), path.size());
1339 if (len < 0) {
1340 return "";
1341 }
1342 if (static_cast<size_t>(len) == path.size()) {
1343 path.resize(path.size() * 2);
1344 }
1345 else {
1346 path.resize(static_cast<std::string::size_type>(len));
1347 break;
1348 }
1349 }
1350
1351 return path;
1352 }
1353};
1354
1355template <typename STACKTRACE_TAG>

Callers

nothing calls this directly

Calls 2

beginMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected