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.
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 withoutO_NOCTTYis enough to acquire it as the controlling terminal — noTIOCSCTTYneeded, and it isn't even defined on this platform).Proposed fix: an
#elif defined(_AIX)branch providingpase_forkpty()/pase_openpty()built on those primitives, wired into the two call sites inPtyFork/PtyOpen, plus removing-lutilfrom the link step forOS=="os400"inbinding.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
bashshell 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.