| 1913 | } |
| 1914 | |
| 1915 | U32 KProcess::getcwd(U32 buffer, U32 size) { |
| 1916 | if (size==0) { |
| 1917 | return -K_EINVAL; |
| 1918 | } |
| 1919 | if (!this->memory->canWrite(buffer, size)) { |
| 1920 | return -K_EFAULT; |
| 1921 | } |
| 1922 | std::shared_ptr<FsNode> node = Fs::getNodeFromLocalPath(B(""), this->currentDirectory, true); |
| 1923 | if (!node || !node->isDirectory()) { |
| 1924 | return -K_ENOENT; |
| 1925 | } |
| 1926 | if ((U32)this->currentDirectory.length()+1>size) |
| 1927 | return -K_ERANGE; |
| 1928 | memory->strcpy(buffer, this->currentDirectory.c_str()); |
| 1929 | return (U32)this->currentDirectory.length()+1; |
| 1930 | } |
| 1931 | |
| 1932 | U32 KProcess::stat64(BString path, U32 buffer) { |
| 1933 | bool isLink = false; |
no test coverage detected