$NetBSD: patch-ac,v 1.4 2013/10/20 18:15:02 joerg Exp $

--- src/pty.c.orig	2002-10-20 06:55:31.000000000 +0000
+++ src/pty.c
@@ -18,11 +18,13 @@
 
 #include <errno.h>
 
+#ifdef HAVE_SYS_STROPTS_H
 #if !defined (__linux__) && !defined(__CYGWIN__) && defined(HAVE_GRANTPT)
 # define USE_SYSV_PTYS
 # include <sys/types.h>
 # include <stropts.h>
 #endif
+#endif
 
 #ifdef HAVE_PTY_H
 # include <pty.h>
@@ -236,6 +238,7 @@ static int pty_open_slave_pty (char *sla
    if (-1 == (fd = signal_safe_open (slave_name, O_RDWR)))
      return -1;
    
+#ifdef I_PUSH
    if ((-1 == ioctl (fd, I_PUSH, "ptem"))
        || (-1 == ioctl (fd, I_PUSH, "ldterm")))
      {
@@ -256,6 +259,7 @@ static int pty_open_slave_pty (char *sla
 	  }
 # endif
      }
+#endif
    *slave = fd;
    return 0;
 }
