fix(libc): return the written length from fputs like FreeBSD #4803
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4803"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Gashrod1 on 2026-10-12T22:26:03Z.
What
fputs_nid_postfixreturned the host'sfputsresult. On success that is 1 on glibc and 0 on the Windows runtime; FreeBSD returns the number of bytes written, capped atINT_MAX(lib/libc/stdio/fputs.c:return (iov.iov_len > INT_MAX ? INT_MAX : iov.iov_len);, in FreeBSD since 11.0).fputs("abc", f)now returns 3 andfputs("", f)returns 0;EOFis still returned on failure.file_streamschecks the exact return for a 17-byte string and for an empty string, where it only checked>= 0before. It fails onmainand passes with the change.Tested
Linux (Arch, GCC), Release,
BUILD_TESTING=ON, based onmainee4962190:file_streamsaborts onmainand passes with the change (3 runs); full build and fullctestpass. Windows (WinLibs MinGW-w64 GCC 15.2.0 r7, NVIDIA RTX 5060), Release,BUILD_TESTING=ON: full build and fullctestpass (1018 tests, the same 7 skipped as onmain). No title or homebrew run.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T02:38:07Z.
Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.
Pull request closed