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

This glues in the code from patch-am (see also path-al and patch-an).

--- os.h.orig	2014-04-26 10:58:35.000000000 +0000
+++ os.h	2014-08-25 17:55:13.000000000 +0000
@@ -71,9 +71,6 @@
 # undef exit
 #endif /* sun */
 
-#ifndef linux /* all done in <errno.h> */
-extern int errno;
-#endif /* linux */
 #ifndef HAVE_STRERROR
 /* No macros, please */
 #undef strerror
@@ -250,9 +247,18 @@
 #endif
 
 #if defined(UTMPOK) || defined(BUGGYGETLOGIN)
-# if defined(SVR4) && !defined(DGUX) && !defined(__hpux) && !defined(linux)
+# if (defined(SVR4) && !defined(DGUX) && !defined(__hpux) && !defined(linux)) \
+  || (defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 106050000)) \
+  || (defined(__DragonFly__) && (__DragonFly_version >= 200902))
 #  include <utmpx.h>
-#  define UTMPFILE	UTMPX_FILE
+#  if defined(__NetBSD__)
+#   define UTMPFILE	_PATH_UTMPX
+#   define NetBSD_UTMP
+#  elif defined(__DragonFly__)
+#   define UTMPFILE _PATH_UTMPX
+#  else
+#   define UTMPFILE	UTMPX_FILE
+#  endif
 #  define utmp		utmpx
 #  define getutent	getutxent
 #  define getutid	getutxid
