Skip to content

No AIX/IBM i PASE support (forkpty/openpty missing, but Unix98 primitives work) #963

Description

@fredsimoncc

forkpty(3)/openpty(3) (BSD convenience wrappers) don't exist on AIX/PASE — no header declares them. However, the underlying POSIX Unix98 primitives (posix_openpt, grantpt, unlockpt, ptsname) are present and fully functional (confirmed with a standalone test: opening a pty, forking, setsid() + open() of the slave without O_NOCTTY is enough to acquire it as the controlling terminal — no TIOCSCTTY needed, and it isn't even defined on this platform).

Proposed fix: an #elif defined(_AIX) branch providing pase_forkpty()/pase_openpty() built on those primitives, wired into the two call sites in PtyFork/PtyOpen, plus removing -lutil from the link step for OS=="os400" in binding.gyp (that library doesn't exist on PASE and isn't needed once forkpty/openpty aren't used directly).

Validated end-to-end on IBM i 7.5 PASE (gcc-12, Node 22): compiled cleanly, spawned a real bash shell through node-pty's JS API, confirmed interactive echo (readline), resize(), and the exit-code callback all work correctly. Also confirmed live through the actual RemoteForI Server (a fork of openvscode-server) in a real browser.

Happy to open a PR with the full patch if useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions