Skip to content

pty_close_inherited_fds() is undefined on any non-Linux, non-macOS platform (build break on FreeBSD/OpenBSD too) #962

Description

@fredsimoncc

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.

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