$NetBSD: patch-ab,v 1.4 2004/09/08 12:47:39 wiz Exp $

--- ncp/mp_serial.c.orig	1999-11-02 21:47:06.000000000 +0100
+++ ncp/mp_serial.c
@@ -37,7 +37,7 @@
 #ifdef sun
 # include <sys/ttold.h>	/* sun has TIOCEXCL there */
 #endif
-#if defined (__SVR4)
+#if defined (__SVR4) || defined(__NetBSD__)
 #include <stdlib.h>
 #endif
 
@@ -223,8 +223,8 @@ int init_serial(const char *dev, int spe
 void ser_exit(int fd)
 {
   struct termios ti;
-  if(ioctl(fd, TCGETS, (caddr_t)&ti) < 0) {
-    perror("TCGETSW");
+  if(tcgetattr(fd, &ti) < 0) {
+    perror("TIOCGETA");
   }
   ti.c_cflag &= ~CRTSCTS;
   if(tcsetattr(fd, TCSANOW, &ti) < 0) {
