17aec1d6eScindi /*
27aec1d6eScindi  * CDDL HEADER START
37aec1d6eScindi  *
47aec1d6eScindi  * The contents of this file are subject to the terms of the
57aec1d6eScindi  * Common Development and Distribution License (the "License").
67aec1d6eScindi  * You may not use this file except in compliance with the License.
77aec1d6eScindi  *
87aec1d6eScindi  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97aec1d6eScindi  * or http://www.opensolaris.org/os/licensing.
107aec1d6eScindi  * See the License for the specific language governing permissions
117aec1d6eScindi  * and limitations under the License.
127aec1d6eScindi  *
137aec1d6eScindi  * When distributing Covered Code, include this CDDL HEADER in each
147aec1d6eScindi  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157aec1d6eScindi  * If applicable, add the following below this CDDL HEADER, with the
167aec1d6eScindi  * fields enclosed by brackets "[]" replaced with your own identifying
177aec1d6eScindi  * information: Portions Copyright [yyyy] [name of copyright owner]
187aec1d6eScindi  *
197aec1d6eScindi  * CDDL HEADER END
207aec1d6eScindi  */
217aec1d6eScindi 
227aec1d6eScindi /*
23c93c462eSCheng Sean Ye  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
247aec1d6eScindi  * Use is subject to license terms.
25f2dbfd32SRobert Mustacchi  * Copyright 2019, Joyent, Inc.
26*d0caeb89SRobert Mustacchi  * Copyright 2020 Oxide Computer Company
277aec1d6eScindi  */
287aec1d6eScindi 
297aec1d6eScindi #include <unistd.h>
30e4b86885SCheng Sean Ye #include <fcntl.h>
317aec1d6eScindi #include <stdio.h>
327aec1d6eScindi #include <stdlib.h>
338a40a695Sgavinm #include <stdarg.h>
347aec1d6eScindi #include <string.h>
357aec1d6eScindi #include <strings.h>
367aec1d6eScindi #include <limits.h>
377aec1d6eScindi #include <alloca.h>
387aec1d6eScindi #include <kstat.h>
397aec1d6eScindi #include <errno.h>
407aec1d6eScindi #include <libnvpair.h>
41