$NetBSD: patch-as,v 1.2 2014/08/25 20:02:32 kim Exp $

--- tty.sh.orig	2014-04-26 16:29:40.000000000 +0000
+++ tty.sh	2014-08-25 19:44:59.000000000 +0000
@@ -812,7 +812,8 @@
   /*
    * Under BSD we have to set the controlling terminal again explicitly.
    */
-# if (defined(__FreeBSD_kernel__) || defined(__GNU__)) && defined(TIOCSCTTY)
+# if (defined(__FreeBSD_kernel__) || defined(__GNU__) || (BSD >= 199103)) \
+  && defined(TIOCSCTTY)
   ioctl(fd, TIOCSCTTY, (char *)0);
 # endif
 
