mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-22 08:33:12 -05:00
ftruncate, truncate and sceKernelFtruncate extended a file through _chsize_s, which writes the whole new length as zero bytes. FreeBSD extends the file without writing data (kern_ftruncate -> ffs_truncate) and fails a length the file system cannot hold with EFBIG. NativeFtruncate now sets the end of file with SetFileInformationByHandle and maps ERROR_DISK_FULL to ENOSPC and ERROR_FILE_TOO_LARGE/ERROR_INVALID_PARAMETER to EFBIG. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>