mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-05 14:37:08 +00:00
[orbis-kernel] Impl sys_getdirentries/sys_getdents
This commit is contained in:
parent
8179a638ad
commit
8f0a90d24b
5 changed files with 89 additions and 4 deletions
|
|
@ -1,6 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
#include "KernelAllocator.hpp"
|
||||
#include "error/ErrorCode.hpp"
|
||||
#include "stat.hpp"
|
||||
#include "utils/Rc.hpp"
|
||||
#include "utils/SharedMutex.hpp"
|
||||
#include <cstdint>
|
||||
|
|
@ -43,5 +45,6 @@ struct File : RcBase {
|
|||
const FileOps *ops = nullptr;
|
||||
Ref<RcBase> device;
|
||||
std::uint64_t nextOff = 0;
|
||||
utils::kvector<Dirent> dirEntries;
|
||||
};
|
||||
} // namespace orbis
|
||||
|
|
|
|||
|
|
@ -23,4 +23,25 @@ struct Stat {
|
|||
int32_t lspare;
|
||||
timespec birthtim; // time of file creation
|
||||
};
|
||||
|
||||
struct Dirent {
|
||||
uint32_t fileno;
|
||||
uint16_t reclen;
|
||||
uint8_t type;
|
||||
uint8_t namlen;
|
||||
char name[256];
|
||||
};
|
||||
|
||||
enum {
|
||||
kDtUnknown = 0,
|
||||
kDtFifo = 1,
|
||||
kDtChr = 2,
|
||||
kDtDir = 4,
|
||||
kDtBlk = 6,
|
||||
kDtReg = 8,
|
||||
kDtLnk = 10,
|
||||
kDtSock = 12,
|
||||
kDtWht = 14,
|
||||
};
|
||||
|
||||
} // namespace orbis
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue