fstyp.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"
#include <fcntl.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <locale.h>
#include <stdlib.h>
#include <strings.h>
#include "ud_lib.h"
extern int optind;
static int verbose;
static int check_if_udfs(int32_t);
int
{
#if !defined(TEXT_DOMAIN)
#define TEXT_DOMAIN "SYS_TEST"
#endif
(void) textdomain(TEXT_DOMAIN);
switch (c) {
case 'v':
verbose++;
break;
default:
errflag++;
break;
}
}
gettext("Usage: fstyp -v special\n"));
exit(1);
}
gettext("udfs fstyp: cannot open <%s> errorno <%d>\n"),
exit(1);
}
/*
* check the volume
*/
return (rval);
}
/*
* Assumption is that we will confirm to level-1
*/
int
{
return (ret);
}
return (1);
}
if (verbose == 0) {
return (0);
}
} else {
}
return (ret);
}
int
{
int32_t i;
/*
* All descriptors are 512 bytes
* except lvd, usd and lvid
* findout the largest and allocate space
*/
}
}
}
return (1);
}
/*
* Anchor Volume Descriptor
*/
return (2);
}
/* LINTED */
}
/*
* Primary Volume Descriptor
*/
if (v->pvd_len != 0) {
return (3);
}
/* LINTED */
}
/*
* Implementation Use descriptor
*/
if (v->iud_len != 0) {
return (3);
}
/* LINTED */
}
/*
* Paritions
*/
for (i = 0; i < n_parts; i++) {
if (v->part_len[i] != 0) {
return (3);
}
/* LINTED */
}
}
/*
* Logical Volume Descriptor
*/
if (v->lvd_len != 0) {
return (3);
}
/* LINTED */
}
/*
* Unallocated Space Descriptor
*/
if (v->usd_len != 0) {
return (3);
}
/* LINTED */
}
/*
* Logical Volume Integrity Descriptor
*/
return (3);
}
/* LINTED */
}
/*
* File Set Descriptor
*/
return (3);
}
/* LINTED */
}
return (0);
}