$NetBSD: patch-ac,v 1.7 2006/08/21 17:23:52 dbj Exp $

--- vl.c.orig	2006-05-06 19:22:32.000000000 +0200
+++ vl.c	2006-05-06 19:28:25.000000000 +0200
@@ -43,7 +47,7 @@
 #include <netdb.h>
 #ifdef _BSD
 #include <sys/stat.h>
-#ifndef __APPLE__
+#ifndef _BSD
 #include <libutil.h>
 #endif
 #else
@@ -1506,7 +1510,7 @@
     return chr;
 }
 
-#if defined(__linux__)
+#if defined(__linux__) || defined(__NetBSD__)
 CharDriverState *qemu_chr_open_pty(void)
 {
     struct termios tty;
@@ -1663,6 +1667,9 @@
 
 static int pp_ioctl(CharDriverState *chr, int cmd, void *arg)
 {
+#ifdef __NetBSD__
+    return ENOTSUP;
+#else
     int fd = (int)chr->opaque;
     uint8_t b;
 
@@ -1696,10 +1703,14 @@
         return -ENOTSUP;
     }
     return 0;
+#endif
 }
 
 CharDriverState *qemu_chr_open_pp(const char *filename)
 {
+#ifdef __NetBSD__
+    return NULL;
+#else
     CharDriverState *chr;
     int fd;
 
@@ -1722,6 +1733,7 @@
     chr->chr_add_read_handler = null_chr_add_read_handler;
     chr->chr_ioctl = pp_ioctl;
     return chr;
+#endif
 }
 
 #else
