VirtualBox

Changeset 617 in kBuild for trunk/src/gmake/kmkbuiltin/strmode.c


Ignore:
Timestamp:
Nov 26, 2006 6:44:45 AM (18 years ago)
Author:
bird
Message:

NetBSD: /strmode.c/1.16/Sun Jun 20 22:20:15 2004

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
    13/*-
    24 * Copyright (c) 1990, 1993
     
    1113 *    notice, this list of conditions and the following disclaimer in the
    1214 *    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
    1816 *    may be used to endorse or promote products derived from this software
    1917 *    without specific prior written permission.
     
    3230 */
    3331
     32#include <sys/cdefs.h>
    3433#if defined(LIBC_SCCS) && !defined(lint)
     34#if 0
    3535static 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
    3839#endif /* LIBC_SCCS and not lint */
    3940
    40 
     41#include "namespace.h"
    4142#include <sys/types.h>
    4243#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>
    4747
    4848void
     
    5151        char *p;
    5252{
     53
     54        _DIAGASSERT(p != NULL);
     55
    5356         /* print type */
    5457        switch (mode & S_IFMT) {
     
    5962                *p++ = 'c';
    6063                break;
    61 #ifdef S_IFBLK
    6264        case S_IFBLK:                   /* block special */
    6365                *p++ = 'b';
    6466                break;
    65 #endif
    6667        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
    6879                break;
    69 #ifndef _MSC_VER
    7080        case S_IFLNK:                   /* symbolic link */
    7181                *p++ = 'l';
    7282                break;
    73 #endif
    7483#ifdef S_IFSOCK
    7584        case S_IFSOCK:                  /* socket */
    7685                *p++ = 's';
    7786                break;
    78 #endif 
     87#endif
    7988#ifdef S_IFIFO
    8089        case S_IFIFO:                   /* fifo */
     
    8594        case S_IFWHT:                   /* whiteout */
    8695                *p++ = 'w';
     96                break;
     97#endif
     98#ifdef S_IFDOOR
     99        case S_IFDOOR:                  /* door */
     100                *p++ = 'D';
    87101                break;
    88102#endif
     
    146160        else
    147161                *p++ = '-';
    148 #ifdef S_ISVTX
    149162        switch (mode & (S_IXOTH | S_ISVTX)) {
    150 #else
    151         switch (mode & (S_IXOTH)) {
    152 #endif
    153163        case 0:
    154164                *p++ = '-';
     
    157167                *p++ = 'x';
    158168                break;
    159 #ifdef S_ISVTX
    160169        case S_ISVTX:
    161170                *p++ = 'T';
     
    164173                *p++ = 't';
    165174                break;
    166 #endif
    167175        }
    168176        *p++ = ' ';             /* will be a '+' if ACL's implemented */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette