https://bugs.gentoo.org/953896 pty.h is necessary on some Linux, but it isn't in POSIX, so it breaks systems like macOS, *BSD, HPUX, AIX and Solaris. Basically everywhere not-Linux, so add guard to only apply on Linux. --- a/pty.c +++ b/pty.c @@ -29,6 +29,9 @@ #include #include #include +#if defined(__linux__) || defined(__linux) || defined(linux) +#include +#endif #include #if defined(__OpenBSD__)