fix(libc): implement openlog and closelog state #5048
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5048"
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 MarcZX10 on 2026-10-13T09:38:36Z.
What
Implement the
openlogandcloseloglibc exports for the existing stderr-backed syslog implementation.openlognow stores the identity and options, appliesLOG_PID, and selects a valid nonzero default facility for messages without an explicit facility. A null identity retains the previous value.closelogclears the identity while retaining options and facility, following FreeBSD 11 behavior. The TechnicalDebt entry documents options that cannot affect this backend because it has no syslog daemon, child-wait, or console sink.Tested
Syslog.cppwith the repository'sGuestSyslog.cppregression test and minimal shims for host libc dependencies; the test passed.-std=c++20 -Wall -Wextra -Werror -fsyntax-only.python3 tools/check_conventions.py --base upstream/main --head HEADpassed.git diff --checkpassed.Checklist
main; no other open PR implements these functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in the library's technical debtImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T09:40:08Z.
Review: CHANGES_REQUESTED
openlog/closelogmatch FreeBSD 11'sopenlog_unlocked/closelog(null ident keeps the tag, only a nonzero valid facility replaces the default,closelogclears only the tag). One thing left:docs/dev/debt/libc.md:60: FreeBSD'svsyslogfalls back togetprogname()as the tag when none is set (lib/libc/gen/syslog.c,LogTag == NULLbranch), including aftercloselog. This backend emits no tag in that case. Please add that to the syslog debt line.Once that is in and the Build workflow is green I'll merge.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T09:42:06Z.
Progress report (
77b9f72→81f727c)➖ System libraries: 88.41% (+0.0%, +2 implemented functions)
✅ 2 implemented
closelog_nid_postfixopenlog_nid_postfixImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T09:42:32Z.
Added the documented limitation that FreeBSD falls back to the program name when no identity is set, while this stderr-backed implementation emits no tag. Pushed as
04f7f528c.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T09:50:03Z.
Rebased onto current
main(bb9a4d8a2) and reran the Linux syslog regression harness, Linux/MinGW syntax checks, conventions, and diff checks successfully. I also corrected the regression'sLOG_PIDexpectation when no identity is set. New head:e4716bcaf.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T09:57:12Z.
Rebased onto current main
77b9f7270after the previous Build matrix passed. On the rebased head81f727c05, the Linux syslog regression harness passes, Linux and MinGW-Wall -Wextra -Werrorsyntax checks pass, and conventions/diff checks pass locally. Hosted checks for this new head have started; the reviewer’s requestedgetprogname()fallback limitation remains documented in the libc debt entry.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T10:18:36Z.
The
getprogname()fallback limitation is now recorded indocs/dev/debt/libc.md, and the latest head (81f727c05) has passed every applicable Build job, including the Linux/macOS/Windows relinker matrix and register-context checks. The full Linux and Windows build jobs were skipped by the workflow path filter. Could you take another look when convenient?Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T10:49:40Z.
Review: APPROVED
Checked
openlog/closelog/vsyslogagainst FreeBSD 11syslog.c(null ident keeps the tag, only a nonzero valid facility replaces the default,closelogclears only the tag), ranguest_sysloglocally (passes with the change, fails to link without it), and thegetprogname()fallback is now in the debt line. Merging once the full Build is green.