Skip to content

Fix getsockopt using host errno when handling level = SOL_SOCKET and optname = SO_ERROR#1476

Open
HeavenVolkoff wants to merge 2 commits into
jart:masterfrom
HeavenVolkoff:fix-getsockopt-so_error
Open

Fix getsockopt using host errno when handling level = SOL_SOCKET and optname = SO_ERROR#1476
HeavenVolkoff wants to merge 2 commits into
jart:masterfrom
HeavenVolkoff:fix-getsockopt-so_error

Conversation

@HeavenVolkoff

Copy link
Copy Markdown

Hello,

Currently, when calling getsockopt with level = SOL_SOCKET and optname = SO_ERROR the resulting out_opt_optval is set to the host's errno and is not converted to a matching Cosmopolitan/Linux errno, which can cause some weird behavior in some applications. This does not affect Windows because sys_getsockopt_nt correctly handles this situation.

@github-actions github-actions Bot added the libc label Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant