Skip to content

feat(libkernel): implement getsid for calling process - #4578

Merged
adriadam10 merged 2 commits into
boykopovar:mainfrom
jagrat04:feat/libkernel-getsid
Oct 12, 2026
Merged

adriadam10 merged 2 commits into
boykopovar:mainfrom
jagrat04:feat/libkernel-getsid

Conversation

@jagrat04

Copy link
Copy Markdown
Contributor

What

Implements getsid (NID gokWod7GAH4) in libkernel. In FreeBSD, getsid returns the session ID of the process (or calling process if pid is 0) and ESRCH (3) for unknown processes. Since AnyPS5 models a single guest process leading its own session, getsid returns the calling process ID for pid 0 or the caller's pid, and fails with ESRCH for any other process ID. Adds unit tests in GuestParentProcess.cpp and updates TechnicalDebt.

Tested

ools/check_conventions.py --base origin/main
ools/nid_names.py --nid gokWod7GAH4

Guest unit tests in core/libs/tests/GuestParentProcess.cpp

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Progress report (e0fad55 → 935e7d6)

📈 System libraries: 87.6% (+0.03%, +1 implemented functions)

✅ 1 implemented
Library Name
libkernel getsid_nid_postfix

@github-actions github-actions Bot added libkernel docs needs rebase Conflicts with main, rebase needed labels Oct 12, 2026
@jagrat04
jagrat04 force-pushed the feat/libkernel-getsid branch from e8c3ccc to 0cbee6e Compare October 12, 2026 18:58
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 12, 2026
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked getsid against FreeBSD's sys_getsid (own pid for 0/self, ESRCH otherwise) and the new cases in GuestParentProcess.

Added on top of your commit:

  • Removed guest_ioctl_getsid (core/libs/tests/GuestIoctlGetsid.cpp and its registration in libkernel/CMakeLists.txt): it asserted the old "process sessions not implemented" throw and fails with this change; GuestParentProcess covers getsid now.
  • Rebased on current main.

Full scoped ctest is green (593 tests); merging once CI is green.

@adriadam10
adriadam10 force-pushed the feat/libkernel-getsid branch from 0cbee6e to 521ad13 Compare October 12, 2026 21:10
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 12, 2026
@adriadam10
adriadam10 force-pushed the feat/libkernel-getsid branch from 521ad13 to 935e7d6 Compare October 12, 2026 21:13
@adriadam10

Copy link
Copy Markdown
Collaborator

Rebased on current main again: the getsid line in docs/dev/debt/libkernel.md conflicted with the sigtimedwait/pause/sigaction entries that landed meanwhile. Only the getsid line is replaced; the neighbouring entries are untouched.

Scoped ctest is green (140 tests, including guest_parent_process); merging once CI is green.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 12, 2026
@adriadam10
adriadam10 merged commit 962aba1 into boykopovar:main Oct 12, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants