The ps5-payload-sdk's fts_build calls __opendir2 with DTF_HIDEW,
DTF_NODUP and DTF_REWIND, and PS5 Bible Reader (PPSA99793) failed to
load on the unresolved import. In FreeBSD 11 those flags only change
reading a union mount, which AnyPS5 does not have, so the call opens
the directory as opendir does; other flags throw.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Remove the stubs whose NIDs main now defines, with their debt entries, and
keep main's own debt entries unchanged: the imports are appended after them.
Remove the one round six stub whose NID main now defines, with its debt
entry, and keep main's own debt entries unchanged: the round six section
is appended after them.
Flags 1 finds any module and flags 2 only non-system ones; other flags return EINVAL instead of throwing, every failure clears the 0x1A8 bytes, and st_size is left 0.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The PS5 3.20 export inventory lists _err, _warn and _getprogname in
libSceLibcInternal next to err, warn and getprogname, with the NIDs
UhKI6z9WWuo, XQFE8Y58WZM and iI6kGxgXzcU. In FreeBSD 11.4 libc the
underscore names are the definitions and the public names are weak
references to them (lib/libc/gen/err.c, lib/libc/gen/getprogname.c),
and libthr interposes none of them, so each pair is one function.
_err and _warn now hand their arguments to verr and vwarn, which use
errno at the call as err and warn do; _getprogname returns
getprogname(). The debt file records that the console's module was not
read.
guest_err checks the _warn and _err text for errno 13 with a formatted
message, that _err passes its status to the err_set_exit hook, and that
_warn without a format returns without calling the hook.
guest_program_name checks that _getprogname returns the current
__progname pointer.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The PS5 3.20 export inventory of libSceLibcInternal lists
__inet_ntoa_r next to inet_ntoa_r, and no AnyPS5 library exported it,
so a title importing it could not resolve it. It now runs inet_ntoa_r:
FreeBSD 11.4's arpa/inet.h names the function __inet_ntoa_r, and
inet_ntoa.c makes inet_ntoa_r a weak alias of it.
__inet_addr, __inet_aton and __inet_ntoa are in the same inventory,
but libc already exports them and the relinker also looks up
libSceLibcInternal imports in libc, so they are not added here.
guest_inet_address formats an address through __inet_ntoa_r into a
buffer of exactly the text's size, and checks that a buffer one byte
short is returned unchanged with ENOSPC and that inet_ntoa's buffer is
left alone.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
__std_init_once_begin_initialize_clr, __std_init_once_complete_clr and
__std_init_once_link_alternate_names_and_abort were not exported. As in
the PS5 12.00 module, begin moves an idle once object to running and
reports pending, reports done without pending, and waits on the object
while another caller runs; complete marks it done, or idle again for
flag 4, wakes every waiter and returns 1; the third aborts.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
The Dinkumware std::filesystem in titles calls twelve low-level helpers
that libSceLibcInternal exports and this project did not: _Stat, _Lstat,
_File_size, _Last_write_time, _Make_dir, _Remove_dir, _Unlink, _Chmod,
_Current_get, _Open_dir, _Read_dir and _Close_dir. They now follow the
PS5 12.00 module on top of the guest stat, mkdir, rmdir, unlink, chmod,
getcwd and directory calls, with its results: file_type codes from the
mode, not_found for ENOENT, ENOTDIR, EINVAL and ENAMETOOLONG, mkdir's
1/0/-errno, -1 for a failed size, and directory reads that skip the dot
entries and report the type as unknown. As on the console, _Lstat
follows links like _Stat.
The two _Xfilesystem_error overloads are exported and still throw, as
the guest filesystem_error type is not provided yet.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
fdopendir listed the directory from its first entry whatever position the
descriptor had, and left FD_CLOEXEC unchanged. FreeBSD 11.4 fdopendir sets
FD_CLOEXEC on the descriptor and preserves the initial seek position (lib/libc/gen/opendir.c).
The Windows directory handle now skips the entries the descriptor already
consumed, the Linux handle duplicates the descriptor, and the test requires both.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Dusklight (PPSA99305) aborts on main as soon as its Select disc image
item is chosen: SDL's file dialog probes "zenity --version" through
posix_spawnp, and posix_spawnp throws "process creation not implemented".
FreeBSD 11.4's posix_spawn returns the error of the child's exec, and
an exec of a program that is in no directory of PATH (_PATH_DEFPATH
when PATH is unset) fails with ENOENT. Both calls now return ENOENT
without writing the process ID when the program is not in the guest
file system, and keep throwing when it is. SDL then reports the file
dialog as unsupported and the title stays on its menu.
Co-Authored-By: Claude Opus 5.5 <[email protected]>