libroot/unistd: Fix write truncating return values of _kern_write.

ssize_t is 64-bit on 64-bit architectures, if we truncate to int
then values above 2GB will be seen as negative and errors instead
of the successes they are.

Seems to fix #16861.
This commit is contained in:
Augustin Cavalier
2025-03-08 00:11:51 -05:00
parent 48ca9d08bb
commit fe70bb7f1e
+1 -1
View File
@@ -21,7 +21,7 @@
ssize_t
write(int fd, void const *buffer, size_t bufferSize)
{
int status = _kern_write(fd, -1, buffer, bufferSize);
ssize_t status = _kern_write(fd, -1, buffer, bufferSize);
RETURN_AND_SET_ERRNO_TEST_CANCEL(status);
}