Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#962 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp

Research direction

Start in src/unix/pty.cc at the platform-conditional definition of pty_close_inherited_fds() and its call in PtyFork's child branch. Compare the Linux, macOS, and shared non-macOS paths, then verify that the chosen portable handling compiles for FreeBSD, OpenBSD, or another supported POSIX platform without an undefined declaration.

Written by the indexing model from the issue text.

Description

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.

Dominant language
TypeScript
Stars
2k
Forks
337
Avg merge
21h 58m
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/node-pty

All issues in microsoft/node-pty

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.