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

Method fstatat64

source/kernel/kprocess.cpp:2374–2398  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2372}
2373
2374U32 KProcess::fstatat64(FD dirfd, BString path, U32 buf, U32 flag) {
2375 BString dir;
2376 U32 result = 0;
2377
2378 if (path.charAt(0) != '/')
2379 result = getCurrentDirectoryFromDirFD(dirfd, dir);
2380
2381 if (result)
2382 return result;
2383 bool isLink = false;
2384
2385 std::shared_ptr<FsNode> node = Fs::getNodeFromLocalPath(dir, path, (flag & 0x100)==0, &isLink);
2386 if (!node) {
2387 return -K_ENOENT;
2388 }
2389
2390 U64 len = node->length();
2391 U32 mode = node->getMode();
2392 if (node->isLink() || isLink) {
2393 mode|=K__S_IFLNK;
2394 }
2395
2396 KSystem::writeStat(this, path, buf, true, 1, node->id, mode, node->rdev, len, 4096, (len + 4095) / 4096, node->lastModified(), node->getHardLinkCount());
2397 return 0;
2398}
2399
2400U32 KProcess::unlinkat(FD dirfd, BString path, U32 flags) {
2401 BString dir;

Callers 1

syscall_fstatat64Function · 0.80

Calls 6

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

Tested by

no test coverage detected