Skip to content

Add compat module to provide openpty/forkpty on aix#5068

Open
dalvescb wants to merge 1 commit intorust-lang:mainfrom
dalvescb:aix-compat
Open

Add compat module to provide openpty/forkpty on aix#5068
dalvescb wants to merge 1 commit intorust-lang:mainfrom
dalvescb:aix-compat

Conversation

@dalvescb
Copy link
Copy Markdown

@dalvescb dalvescb commented Apr 20, 2026

Description

I respectfully would like to request allowing this compat module for AIX to be added. There is precedent for this as solarish also has a module to export the same missing functions openpty and forkpty https://github.com/rust-lang/libc/blob/088a28455a81c6f9cf770cea42b94380d3cc9b05/src/unix/solarish/compat.rs

Without this module, development on AIX would be significantly hindered. nix has its own wrapper for openpty, but most crates use libc directly. Porting the functionality in another crate like nix would require having every other crate that uses libc directly to switch to the nix API, a big ask to simply support a niche OS like AIX. This patch would only affect AIX, and I would be happy to take full responsibility maintaining it

Sources

Checklist

  • [ X] Relevant tests in libc-test/semver have been updated
  • [ X] No placeholder or unstable values like *LAST or *MAX are
    included (see #3131)
  • [X ] Tested locally (cd libc-test && cargo test --target mytarget);
    especially relevant for platforms that may not be checked in CI

@tgross35
Copy link
Copy Markdown
Contributor

Thank you for the interest but we don’t want to add more polyfill in this crate. The Solarish versions are planned to be removed when possible #4045.

Using one of the wrapper crates like nix or rustix is the correct thing to do if you need functionality that isn’t available on some platforms, so users should already be expecting this from other cases. I believe std also has a polyfill for this as well.

Alternatively, the AIX maintainers have been helpful, cc @xingxue-ibm in case this is a planned feature :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants