/*
* 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 (c) 2016 by Delphix. All rights reserved.
*/
#include <assert.h>
#include <sys/zfs_context.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/refcount.h>
#include <dlfcn.h>
/*
* Routines needed by more than one client of libzpool.
*/
void
{
int index = 0;
char u;
while (n >= 1024) {
n = (n + (1024 / 2)) / 1024; /* Round up or down */
index++;
}
u = " KMGTPE"[index];
if (index == 0) {
} else {
}
}
static void
{
(void) printf(" "
" capacity operations bandwidth ---- errors ----\n");
(void) printf("description "
"used avail read write read write read write cksum\n");
}
if (is_log)
prefix = "log ";
(void) printf("%*s%s%*s%*s%*s %5s %5s %5s %5s %5s %5s %5s\n",
indent, "",
desc,
}
return;
for (c = 0; c < children; c++) {
cname = "<unknown>";
}
}
void
{
char *name;
&nvroot) == 0);
&name) == 0);
}
/*
* Sets given global variable in libzpool to given unsigned 32-bit value.
* arg: "<variable>=<value>"
*/
int
{
void *zpoolhdl;
#ifndef _LITTLE_ENDIAN
/*
* On big endian systems changing a 64-bit variable would set the high
* 32 bits instead of the low 32 bits, which could cause unexpected
* results.
*/
"little-endian systems\n", varname);
return (ENOTSUP);
#endif
*varval = '\0';
varval++;
if (val > UINT32_MAX) {
"be a 32-bit unsigned integer\n", varname);
return (EOVERFLOW);
}
} else {
return (EINVAL);
}
"in libzpool.so\n", varname);
return (EINVAL);
}
} else {
"variable\n");
return (EIO);
}
return (0);
}