Index: /trunk/src/gmake/kmkbuiltin/strmode.c
===================================================================
--- /trunk/src/gmake/kmkbuiltin/strmode.c	(revision 616)
+++ /trunk/src/gmake/kmkbuiltin/strmode.c	(revision 617)
@@ -1,2 +1,4 @@
+/*	$NetBSD: strmode.c,v 1.16 2004/06/20 22:20:15 jmc Exp $	*/
+
 /*-
  * Copyright (c) 1990, 1993
@@ -11,9 +13,5 @@
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
@@ -32,17 +30,19 @@
  */
 
+#include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
+#if 0
 static char sccsid[] = "@(#)strmode.c	8.3 (Berkeley) 8/15/94";
-#include <sys/cdefs.h>
-//__FBSDID("$FreeBSD: src/lib/libc/string/strmode.c,v 1.4 2002/03/21 18:44:54 obrien Exp $");
+#else
+__RCSID("$NetBSD: strmode.c,v 1.16 2004/06/20 22:20:15 jmc Exp $");
+#endif
 #endif /* LIBC_SCCS and not lint */
 
-
+#include "namespace.h"
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <string.h>
-#ifdef _MSC_VER
-#include "mscfakes.h"
-#endif 
+
+#include <assert.h>
+#include <unistd.h>
 
 void
@@ -51,4 +51,7 @@
 	char *p;
 {
+
+	_DIAGASSERT(p != NULL);
+
 	 /* print type */
 	switch (mode & S_IFMT) {
@@ -59,22 +62,28 @@
 		*p++ = 'c';
 		break;
-#ifdef S_IFBLK
 	case S_IFBLK:			/* block special */
 		*p++ = 'b';
 		break;
-#endif 
 	case S_IFREG:			/* regular */
-		*p++ = '-';
+#ifdef S_ARCH2
+		if ((mode & S_ARCH2) != 0) {
+			*p++ = 'A';
+		} else if ((mode & S_ARCH1) != 0) {
+			*p++ = 'a';
+		} else {
+#endif
+			*p++ = '-';
+#ifdef S_ARCH2
+		}
+#endif
 		break;
-#ifndef _MSC_VER
 	case S_IFLNK:			/* symbolic link */
 		*p++ = 'l';
 		break;
-#endif
 #ifdef S_IFSOCK
 	case S_IFSOCK:			/* socket */
 		*p++ = 's';
 		break;
-#endif 
+#endif
 #ifdef S_IFIFO
 	case S_IFIFO:			/* fifo */
@@ -85,4 +94,9 @@
 	case S_IFWHT:			/* whiteout */
 		*p++ = 'w';
+		break;
+#endif
+#ifdef S_IFDOOR
+	case S_IFDOOR:			/* door */
+		*p++ = 'D';
 		break;
 #endif
@@ -146,9 +160,5 @@
 	else
 		*p++ = '-';
-#ifdef S_ISVTX
 	switch (mode & (S_IXOTH | S_ISVTX)) {
-#else
-        switch (mode & (S_IXOTH)) {
-#endif
 	case 0:
 		*p++ = '-';
@@ -157,5 +167,4 @@
 		*p++ = 'x';
 		break;
-#ifdef S_ISVTX
 	case S_ISVTX:
 		*p++ = 'T';
@@ -164,5 +173,4 @@
 		*p++ = 't';
 		break;
-#endif 
 	}
 	*p++ = ' ';		/* will be a '+' if ACL's implemented */
