Skip to content

Create close-on-exec pipes without pipe2 on Haiku - #544

Draft
duncanmcqueen wants to merge 1 commit into
Smithay:masterfrom
duncanmcqueen:haiku-cloexec-pipes
Draft

duncanmcqueen wants to merge 1 commit into
Smithay:masterfrom
duncanmcqueen:haiku-cloexec-pipes

Conversation

@duncanmcqueen

@duncanmcqueen duncanmcqueen commented Oct 14, 2026 •

Copy link
Copy Markdown

Create close-on-exec pipes on Haiku without pipe2. Both data offers and primary-selection offers currently use rustix::pipe::pipe_with, which is unavailable on that target.

Add one Haiku-only helper that creates an ordinary pipe and sets FD_CLOEXEC on both descriptors using rustix::io::fcntl_setfd. Other targets keep using pipe_with. The helper takes no flags argument, since its only supported operation is creating a close-on-exec pipe. Owned descriptors are closed automatically if flag setup fails.

Validation:

  • Linux: cargo check --lib passed.
  • Haiku hrev60228 x86_64, Rust 1.99: cargo check --lib --no-default-features passed with local Wayland system-backend patches. Those dependency changes are separate from this PR.
  • A Haiku-only test checks FD_CLOEXEC on both returned pipe ends.
  • The native full unit-test build was blocked by a missing fontconfig development package required by the existing font-kit dev dependency. It is not reported as a passing test run.

This is draft while the related Wayland Haiku support is under review. The original application port used equivalent changes on SCTK 0.19.2/0.20.0; this PR is adapted to current master. Release backports will remain on the downstream fork for Winit 0.30 consumers.

AI assistance: Codex helped prepare the code, test and PR description.

Additional native check: an isolated test using this exact helper passed on Haiku, verifying FD_CLOEXEC on both pipe descriptors. Full toolkit unit tests remain blocked by missing fontconfig development files. Related connection support: Smithay/wayland-rs#979.

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.

1 participant