Merge pull request #800 from darkf/stread

implement cellFsStRead (does *not* use ringbuffers)
This commit is contained in:
B1ackDaemon 2014-09-10 08:02:25 +03:00
commit ff29320a34
2 changed files with 11 additions and 2 deletions

View file

@ -696,15 +696,20 @@ s32 cellFsStReadStop(u32 fd)
s32 cellFsStRead(u32 fd, u32 buf_addr, u64 size, vm::ptr<be_t<u64>> rsize)
{
sys_fs->Todo("cellFsStRead(fd=%d, buf_addr=0x%x, size=0x%llx, rsize_addr = 0x%x)", fd, buf_addr, size, rsize.addr());
sys_fs->Warning("cellFsStRead(fd=%d, buf_addr=0x%x, size=0x%llx, rsize_addr=0x%x)", fd, buf_addr, size, rsize.addr());
LV2_LOCK(0);
vfsStream* file;
if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH;
// TODO: use ringbuffer (fs_config)
fs_config.m_regid += size;
*rsize = fs_config.m_regid;
if (file->Eof())
return CELL_FS_ERANGE;
*rsize = file->Read(vm::get_ptr<void>(buf_addr), size);
return CELL_OK;
}

View file

@ -70,6 +70,10 @@ enum cellFsStStatus
CELL_FS_ST_PROGRESS = 0x0200,
};
enum cellFsErrors
{
CELL_FS_ERANGE = 34
};
#pragma pack(push, 4)