mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-23 00:53:02 -05:00
FreeBSD's printf formats %m as the message for the errno value at the time of the call. On Linux a format with %m went to glibc, which looks the number up in Linux's table, so guest errno values above 34 got another error's text: with errno 35 (EAGAIN) "[%m]" printed "[Resource deadlock avoided]" instead of "[Resource temporarily unavailable]", and errno 63 (ENAMETOOLONG) printed "Out of streams resources". On Windows, and on Linux when the format also had a wide argument, the guest formatter threw on %m. FreeBSD 11.4, lib/libc/stdio/vfprintf.c: saved_errno = errno; ... case 'm': cp = strerror(saved_errno); size = (prec >= 0) ? strnlen(cp, prec) : strlen(cp); sign = '\0'; break; The guest formatter now saves errno when it starts and formats %m as a string with the guest strerror_r text, so width, precision and the - flag apply as FreeBSD's string path applies them. On Linux a format with %m goes to the guest formatter like one with a wide argument. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>