| 929 | } |
| 930 | |
| 931 | static 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 | |
| 953 | U32 KProcess::access(BString path, U32 mode) { |
| 954 | std::shared_ptr<FsNode> node = Fs::getNodeFromLocalPath(this->currentDirectory, path, true); |