MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / readlinkInDirectory

Method readlinkInDirectory

source/kernel/kprocess.cpp:1282–1292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1280}
1281
1282U32 KProcess::readlinkInDirectory(BString currentDirectory, BString path, U32 buffer, U32 bufSize) {
1283 // :TODO: move these to the virtual filesystem
1284 std::shared_ptr<FsNode> node = Fs::getNodeFromLocalPath(currentDirectory, path, false);
1285 if (!node || !node->isLink())
1286 return -K_EINVAL;
1287 U32 len = (U32)node->getLink().length();
1288 if (len>bufSize)
1289 len = bufSize;
1290 memory->memcpy(buffer, node->getLink().c_str(), len);
1291 return len;
1292}
1293
1294U32 KProcess::readlinkat(FD dirfd, BString path, U32 buf, U32 bufsiz) {
1295 BString currentDirectory;

Callers

nothing calls this directly

Calls 5

memcpyMethod · 0.80
isLinkMethod · 0.45
lengthMethod · 0.45
getLinkMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected