Skip to content

feat(libkernel): implement getsid - #4192

Closed
codingreapermaps wants to merge 1 commit into
boykopovar:mainfrom
codingreapermaps:feat/libkernel-getsid
Closed

codingreapermaps wants to merge 1 commit into
boykopovar:mainfrom
codingreapermaps:feat/libkernel-getsid

Conversation

@codingreapermaps

@codingreapermaps codingreapermaps commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What

getsid was a throwing stub. It now follows FreeBSD's kern_getsid (kern_prot.c) for the only guest process: 0 and its own pid return its session id, any other pid returns -1 with ESRCH.

The session id is the guest's own pid: the guest is taken to lead its own session, as kill and setsid already take it to lead its own process group. This is an assumption, not a console measurement, and is recorded in TechnicalDebt.

No open pull request implements getsid; #4138 only has the neighbouring TechnicalDebt line as context.

Tested

Windows 11, MinGW-w64 GCC 15.2.0 (WinLibs r7), full build configuration with BUILD_TESTING=ON. Built and ran guest_ioctl_getsid, guest_kernel_sys and guest_signals: all three pass. The full test suite was not run and no title or homebrew was run. tools/check_conventions.py --base origin/main passes.

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
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

Follow FreeBSD's kern_getsid for the only guest process: 0 and its own
pid return its session id, any other pid reports ESRCH. The guest is
taken to lead its own session, so the session id is its own pid.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

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.

Pull request Conflicting files (lines on main) Same exports Same new files
#4138 docs/dev/TechnicalDebt.md L641-644
#4170 core/libs/prx/libkernel/System/src/Process.cpp L45, L204-206
docs/dev/TechnicalDebt.md L643

@codingreapermaps

Copy link
Copy Markdown
Contributor Author

Closing as a duplicate of #4170, which was opened first and implements the same behaviour. Sorry for the overlap, it wasn't open yet when I started on this.

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.

1 participant