Implement cellFsAllocateFileAreaWithoutZeroFill

And a couple minor null pointer checks in sys_fs.
This commit is contained in:
Raul Tambre 2016-04-09 12:45:45 +03:00
parent 713ae91e27
commit 97083ebba4
No known key found for this signature in database
GPG key ID: FC357D4861AC031E
2 changed files with 9 additions and 3 deletions

View file

@ -1017,9 +1017,10 @@ s32 cellFsChangeFileSizeWithoutAllocation()
throw EXCEPTION(""); throw EXCEPTION("");
} }
s32 cellFsAllocateFileAreaWithoutZeroFill() s32 cellFsAllocateFileAreaWithoutZeroFill(vm::cptr<char> path, u64 size)
{ {
throw EXCEPTION(""); cellFs.warning("cellFsAllocateFileAreaWithoutZeroFill(path=*0x%x, size=0x%llx)", path, size);
return sys_fs_truncate(path, size);
} }
s32 cellFsChangeFileSizeByFdWithoutAllocation() s32 cellFsChangeFileSizeByFdWithoutAllocation()

View file

@ -124,7 +124,12 @@ s32 sys_fs_open(vm::cptr<char> path, s32 flags, vm::ptr<u32> fd, s32 mode, vm::c
s32 sys_fs_read(u32 fd, vm::ptr<void> buf, u64 nbytes, vm::ptr<u64> nread) s32 sys_fs_read(u32 fd, vm::ptr<void> buf, u64 nbytes, vm::ptr<u64> nread)
{ {
sys_fs.trace("sys_fs_read(fd=%d, buf=0x%x, nbytes=0x%llx, nread=0x%x)", fd, buf, nbytes, nread); sys_fs.trace("sys_fs_read(fd=%d, buf=*0x%x, nbytes=0x%llx, nread=*0x%x)", fd, buf, nbytes, nread);
if (!buf)
{
return CELL_EFAULT;
}
const auto file = idm::get<lv2_file_t>(fd); const auto file = idm::get<lv2_file_t>(fd);