Skip to content

Fix unix pathname length when the kernel excludes the null byte - #691

Open
skade wants to merge 1 commit into
rust-lang:masterfrom
skade:qnx8-support
Open

skade wants to merge 1 commit into
rust-lang:masterfrom
skade:qnx8-support

Conversation

@skade

@skade skade commented Nov 19, 2026

Copy link
Copy Markdown

On QNX, FreeBSD and friends, getsockname() and getpeername() report the length of a pathname address without the terminating null byte.

This is similar to what stdlib does, but does not introduce the memchr crate. https://github.com/rust-lang/rust/blob/1c3a65069/library/std/src/os/unix/net/addr.rs#L271-L275

QNX's getsockname() and getpeername() report the length of a pathname address
without the terminating null byte.

@Thomasdezeeuw Thomasdezeeuw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to have a test for this so we don't regress.

@Thomasdezeeuw

Copy link
Copy Markdown
Contributor

Anything else needed for QNX @skade ?

This branch has not been deployed

No deployments
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.

2 participants