Skip to content

Use the FIONREAD value of each Linux architecture - #104

Merged
eed3si9n merged 1 commit into
sbt:1.xfrom
vejeta:fionread-per-arch
Nov 24, 2026
Merged

eed3si9n merged 1 commit into
sbt:1.xfrom
vejeta:fionread-per-arch

Conversation

@vejeta

@vejeta vejeta commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

On Linux, available() always passes 0x541B to ioctl(). PowerPC, SPARC and Alpha use 0x4004667F, and MIPS uses 0x467F, so there ioctl() fails and available() returns 1. AvailableTest.availableCountsPendingBytes fails on ppc64el: https://ci.debian.net/packages/i/ipcsocket/testing/ppc64el/77338930/

This picks the value per architecture. Tested on ppc64el (qemu) and amd64.

available() passed FIONREAD_LINUX (0x541B) to ioctl() on every Linux
system. PowerPC, SPARC and Alpha use 0x4004667F, and MIPS uses 0x467F.
There ioctl() fails with ENOTTY, available() falls back to poll() and
returns 1 instead of the number of pending bytes, so
AvailableTest.availableCountsPendingBytes fails on ppc64el.

@eed3si9n eed3si9n left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@eed3si9n
eed3si9n merged commit 0fe84b9 into sbt:1.x Nov 24, 2026
6 checks passed
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