cfsfstype.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
*
*
* Cache FS admin utility. Used to glean information out of the
* rootfs, frontfs, and backfs variables in the kernel.
*/
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <limits.h>
#include <dirent.h>
#include <ftw.h>
#include <fcntl.h>
#include <ctype.h>
#include <stdarg.h>
static void usage(char *);
/*
*
* main
*
* Description:
* Main routine for the cfsfstype program.
* Arguments:
* argc number of command line arguments
* argv command line arguments
* Returns:
* Returns 0 for failure, > 0 for an error.
* Preconditions:
*/
int
{
int c;
int nflag = 0;
int fd;
/* verify root running command */
if (getuid() != 0) {
return (1);
}
#if !defined(TEXT_DOMAIN)
#define TEXT_DOMAIN "SYS_TEST"
#endif
(void) textdomain(TEXT_DOMAIN);
/* parse the command line arguments */
switch (c) {
case 'n':
nflag = 1;
break;
default:
return (1);
}
}
if (argc > 1) {
return (1);
}
/* if just path is specified, just statvfs it */
if (!nflag) {
if (argc != 1) {
return (1);
}
return (1);
}
return (0);
}
if (fd < 0) {
return (1);
}
if (argc == 1) {
if (fd < 0) {
return (1);
}
}
return (1);
}
return (0);
}
/*
*
* usage
*
* Description:
* Prints a usage message for this utility.
* Arguments:
* msgp message to include with the usage message
* Returns:
* Preconditions:
* precond(msgp)
*/
static void
{
}
/*
*
* pr_err
*
* Description:
* Prints an error message to stderr.
* Arguments:
* fmt printf style format
* ... arguments for fmt
* Returns:
* Preconditions:
* precond(fmt)
*/
static void
{
}