Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / nvlist_add_boolean.9f
blobe50a062d41d48b99c1d583d94323498e003aee70
1 '\" te
2 .\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
3 .\" 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.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" 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]
6 .TH NVLIST_ADD_BOOLEAN 9F "Jan 16, 2006"
7 .SH NAME
8 nvlist_add_boolean, nvlist_add_boolean_value, nvlist_add_byte, nvlist_add_int8,
9 nvlist_add_uint8, nvlist_add_int16, nvlist_add_uint16, nvlist_add_int32,
10 nvlist_add_uint32, nvlist_add_int64, nvlist_add_uint64, nvlist_add_string,
11 nvlist_add_nvlist, nvlist_add_nvpair, nvlist_add_boolean_array,
12 nvlist_add_int8_array, nvlist_add_uint8_array, nvlist_add_nvlist_array,
13 nvlist_add_byte_array, nvlist_add_int16_array, nvlist_add_uint16_array,
14 nvlist_add_int32_array, nvlist_add_uint32_array, nvlist_add_int64_array,
15 nvlist_add_uint64_array, nvlist_add_string_array, nvlist_t \- value pair
16 functions
17 .SH SYNOPSIS
18 .LP
19 .nf
20 #include <sys/nvpair.h>
22 \fBint\fR \fBnvlist_add_boolean\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR);
23 .fi
25 .LP
26 .nf
27 \fBint\fR \fBnvlist_add_boolean_value\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
28       \fBboolean_t\fR \fIval\fR);
29 .fi
31 .LP
32 .nf
33 \fBint\fR \fBnvlist_add_byte\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR, \fBuchar_t\fR \fIval\fR);
34 .fi
36 .LP
37 .nf
38 \fBint\fR \fBnvlist_add_int8\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR, \fBint8_t\fR \fIval\fR);
39 .fi
41 .LP
42 .nf
43 \fBint\fR \fBnvlist_add_uint8\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR, \fBuint8_t\fR \fIval\fR);
44 .fi
46 .LP
47 .nf
48 \fBint\fR \fBnvlist_add_int16\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR, \fBint16_t\fR \fIval\fR);
49 .fi
51 .LP
52 .nf
53 \fBint\fR \fBnvlist_add_uint16\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR, \fBuint16_t\fR \fIval\fR);
54 .fi
56 .LP
57 .nf
58 \fBint\fR \fBnvlist_add_int32\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR, \fBint32_t\fR \fIval\fR);
59 .fi
61 .LP
62 .nf
63 \fBint\fR \fBnvlist_add_uint32\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR, \fBuint32_t\fR \fIval\fR);
64 .fi
66 .LP
67 .nf
68 \fBint\fR \fBnvlist_add_int64\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR, \fBint64_t\fR \fIval\fR);
69 .fi
71 .LP
72 .nf
73 \fBint\fR \fBnvlist_add_uint64\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR, \fBuint64_t\fR \fIval\fR);
74 .fi
76 .LP
77 .nf
78 \fBint\fR \fBnvlist_add_string\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR, \fBchar *\fR\fIval\fR);
79 .fi
81 .LP
82 .nf
83 \fBint\fR \fBnvlist_add_nvlist\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR, \fBnvlist_t *\fR\fIval\fR);
84 .fi
86 .LP
87 .nf
88 \fBint\fR \fBnvlist_add_nvpair\fR(\fBnvlist_t *\fR\fInvl\fR, \fBnvpair_t *\fR\fInvp\fR);
89 .fi
91 .LP
92 .nf
93 \fBint\fR \fBnvlist_add_boolean_array\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
94      \fBboolean_t *\fR\fIval\fR, \fBuint_t\fR \fInelem\fR);
95 .fi
97 .LP
98 .nf
99 \fBint\fR \fBnvlist_add_byte_array\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR, \fBuchar_t *\fR\fIval\fR,
100      \fBuint_t\fR \fInelem\fR);
105 \fBint\fR \fBnvlist_add_int8_array\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR, \fBint8_t *\fR\fIval\fR,
106      \fBuint_t\fR \fInelem\fR);
111 \fBint\fR \fBnvlist_add_uint8_array\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
112      \fBuint8_t *\fR\fIval\fR uint_t nelem);
117 \fBint\fR \fBnvlist_add_int16_array\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR, \fBint16_t *\fR\fIval\fR,
118      \fBuint_t\fR \fInelem\fR);
123 \fBint\fR \fBnvlist_add_uint16_array\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR, \fBuint16_t *\fR\fIval\fR,
124      \fBuint_t\fR \fInelem\fR);
129 \fBint\fR \fBnvlist_add_int32_array\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR, \fBint32_t *\fR\fIval\fR,
130      \fBuint_t\fR \fInelem\fR);
135 \fBint\fR \fBnvlist_add_uint32_array\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR, \fBuint32_t *\fR\fIval\fR,
136      \fBuint_t\fR \fInelem\fR);
141 \fBint\fR \fBnvlist_add_int64_array\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR, \fBint64_t *\fR\fIval\fR,
142      \fBuint_t\fR \fInelem\fR);
147 \fBint\fR \fBnvlist_add_uint64_array\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR, \fBuint64_t *\fR\fIval\fR,
148      \fBuint_t\fR \fInelem\fR);
153 \fBint\fR \fBnvlist_add_string_array\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
154      \fBconst *char *\fR\fIval\fR, \fBuint_t\fR \fInelem\fR);
159 \fBint\fR \fBnvlist_add_nvlist_array\fR(\fBnvlist_t *\fR\fInvl\fR, \fBconst char *\fR\fIname\fR,
160      \fBnvlist_t **\fR\fIval\fR, \fBuint_t\fR \fInelem\fR);
163 .SH INTERFACE LEVEL
166 Solaris DDI specific (Solaris DDI)
167 .SH PARAMETERS
169 .ne 2
171 \fB\fInvl\fR\fR
173 .RS 9n
174 The \fBnvlist_t\fR to be processed.
178 .ne 2
180 \fB\fInvp\fR\fR
182 .RS 9n
183 The \fBnvpair_t\fR (name-value pair) to be processed.
187 .ne 2
189 \fB\fIname\fR\fR
191 .RS 9n
192 Name of the name-value pair (\fBnvpair\fR).
196 .ne 2
198 \fB\fInelem\fR\fR
200 .RS 9n
201 Number of elements in value (that is, array size).
205 .ne 2
207 \fB\fIval\fR\fR
209 .RS 9n
210 Value or starting address of the array value.
213 .SH DESCRIPTION
216 These functions add a new name-value pair to an \fBnvlist_t\fR. The memory
217 allocation policy follows that specified in \fBnvlist_alloc()\fR,
218 \fBnvlist_unpack()\fR, or \fBnvlist_dup()\fR. See \fBnvlist_alloc\fR(9F). The
219 uniqueness of \fBnvpair\fR name and data types follows the \fInvflag\fR
220 argument specified in \fBnvlist_alloc()\fR.
223 If \fBNV_UNIQUE_NAME\fR was specified for \fInvflag\fR, existing \fBnvpair\fRs
224 with matching names are removed before the new \fBnvpair\fR is added.
227 If \fBNV_UNIQUE_NAME_TYPE\fR was specified for \fInvflag\fR, existing
228 \fBnvpair\fRs with matching names and data types are removed before the new
229 \fBnvpair\fR is added.
232 If neither was specified for \fInvflag\fR, the new \fBnvpair\fR is
233 unconditionally added at the end of the list. The library preserves the order
234 of the name-value pairs across packing, unpacking, and duplication.
237 Multiple threads can simultaneously read the same nvlist_t, but only one thread
238 may actively change a given nvlist_t at a time. The caller is responsible for
239 the synchronization.
242 The \fBnvlist_add_boolean()\fR function is deprecated and the
243 \fBnvlist_add_boolean_value()\fR function is used instead.
244 .SH RETURN VALUES
246 .ne 2
248 \fB\fB0\fR\fR
250 .RS 10n
251 success
255 .ne 2
257 \fB\fBEINVAL\fR\fR
259 .RS 10n
260 invalid argument
264 .ne 2
266 \fB\fBENOMEM\fR\fR
268 .RS 10n
269 insufficient memory
272 .SH CONTEXT
275 These functions can be called from interrupt context only if (1) the default
276 allocator is used and the \fBKM_NOSLEEP\fR flag is set, or (2) the specified
277 allocator did not sleep for free memory (for example, if it uses a
278 pre-allocated buffer for memory allocations).
281 See \fBnvlist_alloc\fR(9F) for a description of pluggable allocators and
282 KM_NOSLEEP. These functions can be called from user or kernel context in all
283 cases.