src/unix/pty.cc defines pty_close_inherited_fds() only under #if defined(__linux__), but calls it unconditionally in PtyFork's child branch for every platform that isn't __APPLE__ (i.e. the shared #else branch used by Linux, FreeBSD, OpenBSD, and anything else binding.gyp claims to support). Compiling on FreeBSD/OpenBSD (or any other POSIX platform) should fail with 'pty_close_inherited_fds' was not declared in this scope.
Suggested minimal fix: add a portable fallback (e.g. getrlimit(RLIMIT_NOFILE) + a close() loop from fd 3) under a generic #else branch, or guard the call site itself.
Found while porting node-pty to IBM i PASE (AIX-derived) — see the companion issue about AIX/PASE support for context.
src/unix/pty.ccdefinespty_close_inherited_fds()only under#if defined(__linux__), but calls it unconditionally inPtyFork's child branch for every platform that isn't__APPLE__(i.e. the shared#elsebranch used by Linux, FreeBSD, OpenBSD, and anything elsebinding.gypclaims to support). Compiling on FreeBSD/OpenBSD (or any other POSIX platform) should fail with'pty_close_inherited_fds' was not declared in this scope.Suggested minimal fix: add a portable fallback (e.g.
getrlimit(RLIMIT_NOFILE)+ aclose()loop from fd 3) under a generic#elsebranch, or guard the call site itself.Found while porting node-pty to IBM i PASE (AIX-derived) — see the companion issue about AIX/PASE support for context.