Commit Graph
2 Commits
Author SHA1 Message Date
al3w0f205 5852fd086e test(libkernel): cover truncate failure on negative lengths with EINVAL 2026-10-20 19:05:00 -05:00
xXPBSXxandClaude Sonnet 5.5 bcbcf55b5b fix(libkernel): extend a file with ftruncate without writing zero bytes on Windows
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>
2026-10-20 05:58:22 +02:00