Skip to content

feat(libSceNet): print sockets from sceNetShowNetstat - #8

Closed
KernelPanicNT wants to merge 1 commit into
mainfrom
feat/libscenet-show-netstat
Closed

KernelPanicNT wants to merge 1 commit into
mainfrom
feat/libscenet-show-netstat

Conversation

@KernelPanicNT

Copy link
Copy Markdown
Owner

What

Implements sceNetShowNetstat (NID WxislcDAW5I) as the pool-less form of the existing sceNetShowNetstatWithMemory: it writes the socket count and the same per-socket lines to standard output and returns 0.

Source of the behaviour. No console measurement is involved.

Changes:

  • core/libs/prx/libSceNet/Export.cpp: the socket snapshot and the per-socket printing move out of sceNetShowNetstatWithMemory into two static helpers, unchanged; its output and its EBADF for an unknown pool stay as they are. sceNetShowNetstat takes the snapshot under the network mutex, prints sceNet netstat: sockets=N and the socket lines after releasing it, and returns 0. It moves below the socket registry it reads.
  • core/libs/tests/GuestSceNet.cpp: the stdout capture takes any call. guest_sce_net compares the complete output of sceNetShowNetstat with no socket, with a non-blocking bound listener, and after the socket is closed.
  • docs/dev/debt/libSceNet.md: the existing entry, which listed the signature as unknown, records the Orbital signature and that the output format and any dependency on sceNetInit are unverified.

What stays unverified: the console's output text and destination, and whether the call needs sceNetInit or fails in any case; no case of this call throws. The signature is the PS4 one.

Progress: libSceNet 50/52 → 51/52; system libraries 3249/3678 (88.34%) → 3250/3678 (88.36%) by tools/progress.py on the branch base caee23f.

Tested

Head a02b73aaa614c493dff4516efd4e30d7ffb780ac, base 84b01f9cd042e1d2e9e112f8783aa5a9d26399ee.

  • Linux (Ubuntu 22.04, GCC 12.3.0, Ninja, Release, BUILD_TESTING=ON, tests run under QEMU 8.2 user mode with -cpu EPYC-Rome because the build host lacks AVX2): guest_sce_net_tests 5/5 passes.
  • Negative control: keep the tests and replace only core/libs/prx/libSceNet/Export.cpp with the base version: guest_sce_net_tests fails with sceNetShowNetstat not implemented. Restoring the PR source and rebuilding passes guest_sce_net_tests 5/5.
  • Windows: fork Build workflow pending; result added here when it finishes.
  • Conventions checker and git diff --check pass. The Linux job of the Build workflow now targets the project's self-hosted runner, so it was not run on the fork; no title was run.

Duplicate and overlap check

Checked the files of all 443 open PRs on 2026-10-14 and searched open, merged and closed PRs for sceNetShowNetstat. No open PR implements or names it.

Open PRs sharing a file (pairwise git merge-tree against each PR head):

Earlier PRs on the same export: boykopovar#2831 (merged) declared it as a throwing stub. boykopovar#3963 and boykopovar#5004, which returned 0 and printed nothing, were closed: no title was shown calling it, and the 0 return had no source for what the export does. This PR does print, with the format of boykopovar#4785, but has no console source for the output and no title stop (Unblocks is none).

The branch is one commit on caee23f; none of the newer commits on main (84b01f9) touch these files, and it merges without conflicts.

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 under Silent stubs in their library's technical debt file
  • 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
  • GPUs tested: n/a
  • AI-assisted: yes (Claude)

The int (void) signature is the PS4 one from Orbital's IDA type
database. sceNetShowNetstat writes a sockets= count and the socket lines
of sceNetShowNetstatWithMemory to standard output, without a pool line,
and returns 0. Both calls now share one socket collector and printer.

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

Copy link
Copy Markdown

Progress report (e34c479 → a02b73a)

📈 System libraries: 88.73% (+0.02%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceNet sceNetShowNetstat

@KernelPanicNT

Copy link
Copy Markdown
Owner Author

Withdrawn: open upstream PR boykopovar#5928 already implements the same functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant