| 160 | } |
| 161 | |
| 162 | std::string getAbsolutePath(std::string path, Thread *thread) { |
| 163 | if (!path.starts_with('/')) { |
| 164 | path = "/" + std::string(thread->tproc->cwd) + "/" + path; |
| 165 | } |
| 166 | |
| 167 | path = std::filesystem::path(path).lexically_normal().string(); |
| 168 | |
| 169 | if (!path.starts_with("/dev") && |
| 170 | !path.starts_with("/system")) { // fixme: implement devfs mount |
| 171 | path = std::string(thread->tproc->root) + "/" + path; |
| 172 | } |
| 173 | |
| 174 | return std::filesystem::path(path).lexically_normal().string(); |
| 175 | } |
| 176 | |
| 177 | orbis::SysResult mmap(orbis::Thread *thread, orbis::caddr_t addr, |
| 178 | orbis::size_t len, orbis::sint prot, orbis::sint flags, |