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

Method lstat64

source/kernel/kprocess.cpp:1943–1961  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1941}
1942
1943U32 KProcess::lstat64(BString path, U32 buffer) {
1944 std::shared_ptr<FsNode> node = Fs::getNodeFromLocalPath(this->currentDirectory, path, false);
1945 if (!node) {
1946 return -K_ENOENT;
1947 }
1948
1949 U64 len = 0;
1950 U32 mode = 0;
1951
1952 if (node->isLink()) {
1953 len = node->getLink().length();
1954 mode = K__S_IFLNK | (node->getMode() & 0xFFF);
1955 } else {
1956 len = node->length();
1957 mode = node->getMode();
1958 }
1959 KSystem::writeStat(this, node->path, buffer, true, 1, node->id, mode, node->rdev, len, 4096, (len + 4095) / 4096, node->lastModified(), node->getHardLinkCount());
1960 return 0;
1961}
1962
1963U32 KProcess::fstat64(FD handle, U32 buf) {
1964 KFileDescriptorPtr fd = this->getFileDescriptor(handle);

Callers 1

syscall_lstat64Function · 0.80

Calls 6

getHardLinkCountMethod · 0.80
isLinkMethod · 0.45
lengthMethod · 0.45
getLinkMethod · 0.45
getModeMethod · 0.45
lastModifiedMethod · 0.45

Tested by

no test coverage detected