/*
* 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"
/*
* Just in case we're not in a build environment, make sure that
* TEXT_DOMAIN gets set to something.
*/
#if !defined(TEXT_DOMAIN)
#endif
/*
* report metadevice status
*/
#include <meta.h>
/*
* print named metadevice
*/
int
mdnamelist_t **nlpp,
char *fname,
)
{
char *miscname;
/* must have set */
/* get type */
return (-1);
/* dispatch */
}
}
}
}
}
/* unknown type */
}
/*
* print all metadevices
*/
int
char *fname,
mdnamelist_t **nlpp,
int *meta_print_trans_msgp,
)
{
int rval = 0;
/* print various types (save first error) */
rval = -1;
}
rval = -1;
}
rval = -1;
}
rval = -1;
}
rval = -1;
}
rval = -1;
}
rval = -1;
}
/* discard further errors */
mdclrerror(&status);
/* return success */
return (rval);
}
/*
* format timestamp
*/
char *
)
{
char *dcmsg;
return ("");
/*
* TRANSLATION_NOTE_LC_TIME
* This message is the format of file
* timestamps written with the -C and
* -c options.
* %a -- locale's abbreviated weekday name
* %b -- locale's abbreviated month name
* %e -- day of month [1,31]
* %T -- Time as %H:%M:%S
* %Y -- Year, including the century
*/
}
return (buf);
}
/*
* format high resolution time into a tuple of seconds:milliseconds:microseconds
*/
char *
)
{
msec %= 1000;
usec %= 1000;
usec);
return (buf);
}
/*
* Routine to print 32 bit bitmasks
*
* Takes:
* fp - a file descriptor
* fmt - optional text
* ul - unsigned long bit vector
* bitfmt - special string to map bits to words.
* bitfmt is layed out as follows:
* byte 0 is the output base.
* byte 1 a bit position less than 32
* byte 2-n text for position in byte 1
* byte n+1 another bit position
* byte n+2-m text for position in byte n+1
* .
* .
* .
*
* Eg. - "\020\001DOG\002CAT\003PIG"
* Print the bitmask in hex.
* If bit 1 (0x0001) is set print "<DOG>"
* If bit 2 (0x0002) is set print "<CAT>"
* If bit 3 (0x0004) is set print "<PIG>"
* If bit 4 (0x0008) is set nothing is printed.
* If bit 1 and bit 2 (0x0003) are set print <DOG,CAT>
*
* Returns 0 on OK
* EOF on error
*
* Outputs on fp
*
*/
int
{
unsigned long ul;
int set;
int n;
char *p;
return (EOF);
switch (*p++) {
case 8:
return (EOF);
break;
case 16:
return (EOF);
break;
default:
case 10:
return (EOF);
break;
}
if (! ul)
return (0);
return (EOF);
for (/* void */; (n = *p) > ' '; ++p)
return (EOF);
set = 1;
} else
for (/* void */; *p > ' '; ++p);
}
if (set)
return (EOF);
return (0);
}
/*
* Convert a number of blocks to a string representation
* Input: 64 bit wide number of blocks
* Outout: string like "199MB" or "27TB" or "3.5GB"
* Returns a pointer to the buffer.
*/
char *
{
char *M = " KMGTPE"; /* kilo, mega, giga, tera, peta, exa */
/* convert from blocks to bytes */
/*
* Stop scaling when we reached exa bytes, then something is
* probably wrong with our number.
*/
uom++; /* next unit of measurement */
save = total_bytes;
}
/* check if we should output a decimal place after the point */
/* sprintf() will round for us */
} else {
}
return (buf);
}
/*
* meta_get_tstate: get the transient state bits from the kernel.
* this is for use with printing out the state field in metastat.
* INPUT: dev64 -- devt of the metadevice
* tstatep -- return for tstate
* ep -- error
* RETURN: -1 for error
* 0 for success
*/
int
{
}
return (0);
}
/*
* meta_print_devid: print out the devid information, given a mddevid_t list.
* INPUT: mdsetname_t set we're looking at
* FILE where to print to
* mddevid_t list to print from.
* md_error_t error
* RETURN: -1 for error
* 0 for success
*/
int
)
{
int len = 0;
int freedevid = 0;
/* print header */
return (-1);
/*
* Building a format string on the fly that will
* be used in (f)printf. This allows the length
* of the ctd to vary from small to large without
* looking horrible.
*/
while (tmp_mddevidp != NULL) {
}
gettext("Device "),
gettext("Reloc"),
gettext("Device ID")) < 0)
return (-1);
/* print ctd's and devids */
did = (ddi_devid_t)
devid = "-";
freedevid = 0;
} else {
freedevid = 1;
}
return (-1);
if (freedevid == 1)
}
return (0);
}