mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-20 22:05:12 +00:00
[orbis-kernel] impi: implement server ops
stub mkdir/rmdir syscalls
This commit is contained in:
parent
ca58c03eb6
commit
7ea6f3d91a
6 changed files with 76 additions and 6 deletions
|
|
@ -292,13 +292,32 @@ orbis::SysResult orbis::sys_renameat(Thread *thread, sint oldfd, ptr<char> old,
|
|||
return ErrorCode::NOSYS;
|
||||
}
|
||||
orbis::SysResult orbis::sys_mkdir(Thread *thread, ptr<char> path, sint mode) {
|
||||
if (auto mkdir = thread->tproc->ops->mkdir) {
|
||||
return mkdir(thread, path, mode);
|
||||
}
|
||||
return ErrorCode::NOSYS;
|
||||
}
|
||||
orbis::SysResult orbis::sys_mkdirat(Thread *thread, sint fd, ptr<char> path,
|
||||
mode_t mode) {
|
||||
return ErrorCode::NOSYS;
|
||||
Ref<File> file = thread->tproc->fileDescriptors.get(fd);
|
||||
if (file == nullptr) {
|
||||
return ErrorCode::BADF;
|
||||
}
|
||||
|
||||
auto mkdir = file->ops->mkdir;
|
||||
|
||||
if (mkdir == nullptr) {
|
||||
return ErrorCode::NOTSUP;
|
||||
}
|
||||
std::lock_guard lock(file->mtx);
|
||||
|
||||
return mkdir(file.get(), path, mode);
|
||||
}
|
||||
|
||||
orbis::SysResult orbis::sys_rmdir(Thread *thread, ptr<char> path) {
|
||||
if (auto rmdir = thread->tproc->ops->rmdir) {
|
||||
return rmdir(thread, path);
|
||||
}
|
||||
return ErrorCode::NOSYS;
|
||||
}
|
||||
orbis::SysResult orbis::sys_getdirentries(Thread *thread, sint fd,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue