/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <stdio.h>
#include <unistd.h>
#include <ftw.h>
#include <strings.h>
#include <stdlib.h>
#include "stdusers.h"
/*ARGSUSED2*/
static int
{
char ftype;
char *abs_name;
char *p;
int c;
int inum;
/*
* The first directory is the current directory '.',
* this is relevant in our protolist, so I throw it out.
*/
if (first_time) {
first_time = 0;
return (0);
}
/*
* is this a relocatable object? if so set
* the symsrc appropriately.
*
* All relocatable objects start with /sun or /i86
*
* eg:
*/
#if defined(sparc)
#else
#error "Unknown instruction set"
#endif
return (0);
*p++ = '\0';
}
}
case S_IFCHR:
ftype = 'c';
break;
case S_IFDIR:
ftype = 'd';
break;
case S_IFBLK:
ftype = 'b';
break;
case S_IFREG:
ftype = 'f';
break;
case S_IFLNK:
perror("readlink");
symsrc[c] = '\0';
ftype = 's';
break;
default:
ftype = '?';
break;
}
uid = "NO_SUCH_UID";
gid = "NO_SUCH_GID";
inum = 0;
else
(void) printf("%c %-30s %-20s %4lo %-5s %-5s %6d %2ld %2s %2s\n",
return (0);
}
int
{
if (argc != 2) {
exit(1);
}
perror("chdir");
exit(1);
}
perror("nftw");
exit(1);
}
return (0);
}