Skip to content

fix(libkernel): datagram accept errno proposal (withdrawn) - #2082

Closed
STUPIDCONTEM wants to merge 1 commit into
boykopovar:mainfrom
STUPIDCONTEM:fix/accept-unsupported-sockets
Closed

STUPIDCONTEM wants to merge 1 commit into
boykopovar:mainfrom
STUPIDCONTEM:fix/accept-unsupported-sockets

Conversation

@STUPIDCONTEM

@STUPIDCONTEM STUPIDCONTEM commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Evidence review (2026-10-09)

Withdrawn: the proposed EOPNOTSUPP expectation was incorrect for FreeBSD datagram accept (EINVAL). This patch must not be applied or reopened as written.

Game/title ID: none verified. No PS5 title execution is claimed.

Withdrawn after kernel-source verification

The general FreeBSD intro(2) example conflicts with the actual stable/11 kernel path. kern_accept4 returns EINVAL when SO_ACCEPTCONN is absent, before calling the protocol accept handler. An ordinary UDP socket does not establish a listening state. Therefore the EOPNOTSUPP change is not sufficiently supported for the guest contract, and this PR is withdrawn; the existing behavior should remain pending direct PS5/FreeBSD validation. The regression below asserted the proposed result and does not establish that the proposal was correct.

Source: https://github.com/freebsd/freebsd-src/blob/stable/11/sys/kern/uipc_syscalls.c


What

Return guest EOPNOTSUPP (45) when accept is called on a datagram socket. The previous combined type/argument guard returned EINVAL (22), conflating an unsupported socket operation with malformed stream-socket arguments. Keep EINVAL for a nonnull address with null length, and preserve EBADF for a closed descriptor.

This follows FreeBSD stable/11 intro(2), EOPNOTSUPP and matches the runtime's existing listen-on-datagram error convention.

Tested

Windows 10 Pro 19045, WinLibs GCC 15.2.0 UCRT posix SEH r7, Release, BUILD_TESTING=ON; independent branch from main f145139.

  • GuestUdp now checks accept on an open datagram socket returns -1/EOPNOTSUPP and on its closed descriptor returns -1/EBADF. The UDP regression fails on unchanged upstream and passes with the split guard.
  • GuestTcp checks malformed address/length arguments on a listening stream socket still return -1/EINVAL; its existing non-listening-stream check remains.
  • Both focused tests passed three repetitions each. Default and explicit libs builds passed; full CTest passed 488/488 in 26.02 seconds.
  • Parent independently reviewed implementation and test scope; conventions, whitespace and test-registration checks passed.

No Linux or title run was performed. Open #2079 changes nonblocking inheritance immediately after this accept guard; retain both changes when integrating. #2080 handles connect errors and adds a separate TCP regression. Exact open-PR diff inspection found no other change to this type-error guard.

Checklist

  • Based on current main; no other open PR implements the same change (historical base; current readiness not asserted)
  • One topic per PR; follow-ups go in a new PR
  • No comments added to code
  • No silent stubs added
  • No investigation notes, reports or images added to the repository
  • No third-party code added
  • Generic behavior, not specific to one title
  • Depends on: none
  • AI-assisted: yes; parent independently reviewed and tested the final change

@STUPIDCONTEM STUPIDCONTEM changed the title fix(libkernel): reject datagram accept with EOPNOTSUPP fix(libkernel): datagram accept errno proposal (withdrawn) Oct 10, 2026
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