mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-12-04 16:40:32 +00:00
* fix(libc): fail fputs, fputc and fprintf on a closed stream as a PS5 does * test(libc): expect fputc on a stream fcloseall closed to leave errno unchanged Co-authored-by: brajan.kw <brajan.kwiatkowski@protonmail.com>
738 B
738 B
libc
change [freopen of a closed stream]
freopenof a closed stream (libc) opens the file on a new host descriptor, sofilenoafterfclose(stdout)andfreopen(path, mode, stdout)is whatever the host hands out, where a PS5 takes the lowest free descriptor. The stream object is kept and reopened as there, and a missing path (ENOENT), an overlong one (ENAMETOOLONG) and a null filename (EBADF) answer as measured on a console. On the closed streamfputsandfputc(whichputc,putcharand__swbufforward to) return -1 leavingerrnounchanged andfprintfgivesEINVAL, as measured on the console; the other writes, unmeasured, answerEBADF.