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

Function internalAccess

source/kernel/kprocess.cpp:931–951  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

929}
930
931static S32 internalAccess(std::shared_ptr<FsNode> node, U32 flags) {
932 if (!node) {
933 return -K_ENOENT;
934 }
935 if (flags==0)
936 return 0;
937 if ((flags & 4)!=0) {
938 if (!node->canRead()) {
939 return -K_EACCES;
940 }
941 }
942 if ((flags & 2)!=0) {
943 if (!node->canWrite()) {
944 return -K_EACCES;
945 }
946 }
947 if ((flags & 1)!=0) {
948 kdebug("access not fully implemented. Can't test for executable permission");
949 }
950 return 0;
951}
952
953U32 KProcess::access(BString path, U32 mode) {
954 std::shared_ptr<FsNode> node = Fs::getNodeFromLocalPath(this->currentDirectory, path, true);

Callers 2

accessMethod · 0.85
faccessatMethod · 0.85

Calls 3

kdebugFunction · 0.85
canReadMethod · 0.45
canWriteMethod · 0.45

Tested by

no test coverage detected