Changeset 617 in kBuild
- Timestamp:
- Nov 26, 2006 6:44:45 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gmake/kmkbuiltin/strmode.c
r370 r617 1 /* $NetBSD: strmode.c,v 1.16 2004/06/20 22:20:15 jmc Exp $ */ 2 1 3 /*- 2 4 * Copyright (c) 1990, 1993 … … 11 13 * notice, this list of conditions and the following disclaimer in the 12 14 * documentation and/or other materials provided with the distribution. 13 * 3. All advertising materials mentioning features or use of this software 14 * must display the following acknowledgement: 15 * This product includes software developed by the University of 16 * California, Berkeley and its contributors. 17 * 4. Neither the name of the University nor the names of its contributors 15 * 3. Neither the name of the University nor the names of its contributors 18 16 * may be used to endorse or promote products derived from this software 19 17 * without specific prior written permission. … … 32 30 */ 33 31 32 #include <sys/cdefs.h> 34 33 #if defined(LIBC_SCCS) && !defined(lint) 34 #if 0 35 35 static char sccsid[] = "@(#)strmode.c 8.3 (Berkeley) 8/15/94"; 36 #include <sys/cdefs.h> 37 //__FBSDID("$FreeBSD: src/lib/libc/string/strmode.c,v 1.4 2002/03/21 18:44:54 obrien Exp $"); 36 #else 37 __RCSID("$NetBSD: strmode.c,v 1.16 2004/06/20 22:20:15 jmc Exp $"); 38 #endif 38 39 #endif /* LIBC_SCCS and not lint */ 39 40 40 41 #include "namespace.h" 41 42 #include <sys/types.h> 42 43 #include <sys/stat.h> 43 #include <string.h> 44 #ifdef _MSC_VER 45 #include "mscfakes.h" 46 #endif 44 45 #include <assert.h> 46 #include <unistd.h> 47 47 48 48 void … … 51 51 char *p; 52 52 { 53 54 _DIAGASSERT(p != NULL); 55 53 56 /* print type */ 54 57 switch (mode & S_IFMT) { … … 59 62 *p++ = 'c'; 60 63 break; 61 #ifdef S_IFBLK62 64 case S_IFBLK: /* block special */ 63 65 *p++ = 'b'; 64 66 break; 65 #endif66 67 case S_IFREG: /* regular */ 67 *p++ = '-'; 68 #ifdef S_ARCH2 69 if ((mode & S_ARCH2) != 0) { 70 *p++ = 'A'; 71 } else if ((mode & S_ARCH1) != 0) { 72 *p++ = 'a'; 73 } else { 74 #endif 75 *p++ = '-'; 76 #ifdef S_ARCH2 77 } 78 #endif 68 79 break; 69 #ifndef _MSC_VER70 80 case S_IFLNK: /* symbolic link */ 71 81 *p++ = 'l'; 72 82 break; 73 #endif74 83 #ifdef S_IFSOCK 75 84 case S_IFSOCK: /* socket */ 76 85 *p++ = 's'; 77 86 break; 78 #endif 87 #endif 79 88 #ifdef S_IFIFO 80 89 case S_IFIFO: /* fifo */ … … 85 94 case S_IFWHT: /* whiteout */ 86 95 *p++ = 'w'; 96 break; 97 #endif 98 #ifdef S_IFDOOR 99 case S_IFDOOR: /* door */ 100 *p++ = 'D'; 87 101 break; 88 102 #endif … … 146 160 else 147 161 *p++ = '-'; 148 #ifdef S_ISVTX149 162 switch (mode & (S_IXOTH | S_ISVTX)) { 150 #else151 switch (mode & (S_IXOTH)) {152 #endif153 163 case 0: 154 164 *p++ = '-'; … … 157 167 *p++ = 'x'; 158 168 break; 159 #ifdef S_ISVTX160 169 case S_ISVTX: 161 170 *p++ = 'T'; … … 164 173 *p++ = 't'; 165 174 break; 166 #endif167 175 } 168 176 *p++ = ' '; /* will be a '+' if ACL's implemented */
Note:
See TracChangeset
for help on using the changeset viewer.