feat(libc): implement syslog and vsyslog #1729
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1729"
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 johnmaia on 2026-10-08T17:47:03Z.
What
Implements
syslog(NIDs-e0hFe21FA) andvsyslog(NIDrzvf5zicF88) in libc. Two of the homebrew titles in #1578 importsyslogfrom libSceLibcInternal, which resolves through libc: ps5-opengl (PPSA99005) and ProsperoRadio (PPSA99001).stderras[syslog:<priority>] <message>, under a lock and flushed, with a newline added when the message has none. This is the same conventionsceKernelDebugOutTextuses ([debug:<channel>]).vsyslog:%mexpands to the guest errno's message (FreeBSD numbering viastrerror_r), with any%in it doubled, and%%mstays a literal%m.LOG_PRIMASK | LOG_FACMASKproducesyslog: unknown facility/priority: <hex>and are then masked off.LOG_USER.vfprintf: SysVva_liston Linux andLibcDetail::FormatWindowson Windows.stderrinstead of the console's system log, andopenlog,setlogmaskandcloselogare not implemented, so identity, options and mask are not applied. Neither title imports them.Tested
New
guest_syslogtest, registered in ctest. It capturesstderrand checks the exact output for:%mwith errno 2, a literal%%mand%%;0x10004, the warning line followed by the masked message);It also checks that errno is unchanged.
Linux (Ubuntu 24.04.5, GCC 13.3) and Windows 11 (WinLibs GCC 15.2.0 r7):
guest_syslog,guest_errors,guest_formattingandguest_filesystempass.No title was run: both titles still have other missing imports listed in #1578.
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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-08T17:47:31Z.
Progress report (
54f28f2→9d1ac90)📈 System libraries: 85.31% (+0.01%, +2 implemented functions)
✅ 2 implemented
syslog_nid_postfixvsyslog_nid_postfixImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-08T17:50:46Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)__error_nid_postfix__error_nid_postfix__error_nid_postfixdocs/dev/TechnicalDebt.mdL362__error_nid_postfix__error_nid_postfixcore/libs/prx/libc/CMakeLists.txtL235__error_nid_postfixImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-09T21:29:00Z.
Checked build + full ctest on Linux (
guest_syslogpasses and fails without the change), and%m/%%/facility handling against FreeBSDlib/libc/gen/syslog.c; the Windows relinker failure is the runner's clang lacking the amdgcn target, unrelated to this PR.One fix added as a separate commit on your branch:
syslog(LOG_ERR|LOG_CONS|LOG_PERROR|LOG_PID, ...), so the priority it logs is0x23, not3.Syslog.cpp, the test expectation ([syslog:35]) and the TechnicalDebt line now say so.Not verified here: Windows runtime of the formatting path and any title. Merging once CI is green.