1nvlist_add_boolean(9F)   Kernel Functions for Drivers   nvlist_add_boolean(9F)
2
3
4

NAME

6       nvlist_add_boolean,      nvlist_add_boolean_value,     nvlist_add_byte,
7       nvlist_add_int8, nvlist_add_uint8, nvlist_add_int16, nvlist_add_uint16,
8       nvlist_add_int32,          nvlist_add_uint32,         nvlist_add_int64,
9       nvlist_add_uint64,        nvlist_add_string,         nvlist_add_nvlist,
10       nvlist_add_nvpair,   nvlist_add_boolean_array,   nvlist_add_int8_array,
11       nvlist_add_uint8_array, nvlist_add_nvlist_array, nvlist_add_byte_array,
12       nvlist_add_int16_array,                        nvlist_add_uint16_array,
13       nvlist_add_int32_array,                        nvlist_add_uint32_array,
14       nvlist_add_int64_array,                        nvlist_add_uint64_array,
15       nvlist_add_string_array, nvlist_t - value pair functions
16

SYNOPSIS

18       #include <sys/nvpair.h>
19
20       int nvlist_add_boolean(nvlist_t *nvl, const char *name);
21
22
23       int nvlist_add_boolean_value(nvlist_t *nvl, const char *name,
24             boolean_t val);
25
26
27       int nvlist_add_byte(nvlist_t *nvl, const char *name, uchar_t val);
28
29
30       int nvlist_add_int8(nvlist_t *nvl, const char *name, int8_t val);
31
32
33       int nvlist_add_uint8(nvlist_t *nvl, const char *name, uint8_t val);
34
35
36       int nvlist_add_int16(nvlist_t *nvl, const char *name, int16_t val);
37
38
39       int nvlist_add_uint16(nvlist_t *nvl, const char *name, uint16_t val);
40
41
42       int nvlist_add_int32(nvlist_t *nvl, const char *name, int32_t val);
43
44
45       int nvlist_add_uint32(nvlist_t *nvl, const char *name, uint32_t val);
46
47
48       int nvlist_add_int64(nvlist_t *nvl, const char *name, int64_t val);
49
50
51       int nvlist_add_uint64(nvlist_t *nvl, const char *name, uint64_t val);
52
53
54       int nvlist_add_string(nvlist_t *nvl, const char *name, char *val);
55
56
57       int nvlist_add_nvlist(nvlist_t *nvl, const char *name, nvlist_t *val);
58
59
60       int nvlist_add_nvpair(nvlist_t *nvl, nvpair_t *nvp);
61
62
63       int nvlist_add_boolean_array(nvlist_t *nvl, const char *name,
64            boolean_t *val, uint_t nelem);
65
66
67       int nvlist_add_byte_array(nvlist_t *nvl, const char *name, uchar_t *val,
68            uint_t nelem);
69
70
71       int nvlist_add_int8_array(nvlist_t *nvl, const char *name, int8_t *val,
72            uint_t nelem);
73
74
75       int nvlist_add_uint8_array(nvlist_t *nvl, const char *name,
76            uint8_t *val uint_t nelem);
77
78
79       int nvlist_add_int16_array(nvlist_t *nvl, const char *name, int16_t *val,
80            uint_t nelem);
81
82
83       int nvlist_add_uint16_array(nvlist_t *nvl, const char *name, uint16_t *val,
84            uint_t nelem);
85
86
87       int nvlist_add_int32_array(nvlist_t *nvl, const char *name, int32_t *val,
88            uint_t nelem);
89
90
91       int nvlist_add_uint32_array(nvlist_t *nvl, const char *name, uint32_t *val,
92            uint_t nelem);
93
94
95       int nvlist_add_int64_array(nvlist_t *nvl, const char *name, int64_t *val,
96            uint_t nelem);
97
98
99       int nvlist_add_uint64_array(nvlist_t *nvl, const char *name, uint64_t *val,
100            uint_t nelem);
101
102
103       int nvlist_add_string_array(nvlist_t *nvl, const char *name,
104            const *char *val, uint_t nelem);
105
106
107       int nvlist_add_nvlist_array(nvlist_t *nvl, const char *name,
108            nvlist_t **val, uint_t nelem);
109
110

INTERFACE LEVEL

112       Solaris DDI specific (Solaris DDI)
113

PARAMETERS

115       nvl      The nvlist_t to be processed.
116
117
118       nvp      The nvpair_t (name-value pair) to be processed.
119
120
121       name     Name of the name-value pair (nvpair).
122
123
124       nelem    Number of elements in value (that is, array size).
125
126
127       val      Value or starting address of the array value.
128
129

DESCRIPTION

131       These functions add a new name-value pair to an  nvlist_t.  The  memory
132       allocation   policy   follows   that   specified   in   nvlist_alloc(),
133       nvlist_unpack(), or nvlist_dup(). See nvlist_alloc(9F). The  uniqueness
134       of  nvpair name and data types follows the nvflag argument specified in
135       nvlist_alloc().
136
137
138       If NV_UNIQUE_NAME was  specified  for  nvflag,  existing  nvpairs  with
139       matching names are removed before the new nvpair is added.
140
141
142       If  NV_UNIQUE_NAME_TYPE was specified for nvflag, existing nvpairs with
143       matching names and data types are removed  before  the  new  nvpair  is
144       added.
145
146
147       If  neither was specified for nvflag, the new nvpair is unconditionally
148       added at the end of the list. The library preserves the  order  of  the
149       name-value pairs across packing, unpacking, and duplication.
150
151
152       Multiple  threads  can  simultaneously read the same nvlist_t, but only
153       one thread may actively change a given nvlist_t at a time.  The  caller
154       is responsible for the synchronization.
155
156
157       The    nvlist_add_boolean()    function    is    deprecated   and   the
158       nvlist_add_boolean_value() function is used instead.
159

RETURN VALUES

161       0         success
162
163
164       EINVAL    invalid argument
165
166
167       ENOMEM    insufficient memory
168
169

CONTEXT

171       These functions can be called from interrupt context only  if  (1)  the
172       default  allocator  is  used and the KM_NOSLEEP flag is set, or (2) the
173       specified allocator did not sleep for free memory (for example,  if  it
174       uses a pre-allocated buffer for memory allocations).
175
176
177       See  nvlist_alloc(9F)  for  a  description  of pluggable allocators and
178       KM_NOSLEEP. These functions can be called from user or  kernel  context
179       in all cases.
180
181
182
183SunOS 5.11                        16 Jan 2006           nvlist_add_boolean(9F)
Impressum