$NetBSD: patch-ad,v 1.4 2025/09/08 07:43:34 vins Exp $ * Support openpty() on NetBSD. * The local utils.h header is required for myopen(). * Add DragonFly --- my_pty.c.orig 2024-08-13 10:49:48.000000000 +0000 +++ my_pty.c @@ -26,7 +26,7 @@ #ifdef __APPLE__ #include #endif -#ifdef __OpenBSD__ +#if defined(__OpenBSD__) || defined(__NetBSD__) #include #endif #if defined(linux) || defined(__CYGWIN__) || defined(__GNU__) || defined(__GLIBC__) @@ -56,7 +56,9 @@ #include #include "error.h" - +#if defined(__sun) || defined(AIX) || defined(_HPUX_SOURCE) +#include "utils.h" +#endif /* the following code was mostly taken from: */ @@ -78,7 +80,7 @@ int get_pty_and_fork(int *fd_master, int *fd_slave) { -#if defined(__FreeBSD__) || defined(linux) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__GNU__) || defined(__GLIBC__) || defined(__minix) +#if defined(__FreeBSD__) || defined(linux) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__GNU__) || defined(__GLIBC__) || defined(__minix) || defined(__DragonFly__) if (openpty(fd_master, fd_slave, NULL, NULL, NULL) == -1) {