1nvlist_lookup_boolean(9F)Kernel Functions for Driversnvlist_lookup_boolean(9F)
2
3
4

NAME

6       nvlist_lookup_boolean, nvlist_lookup_boolean_value, nvlist_lookup_byte,
7       nvlist_lookup_int8,      nvlist_lookup_int16,      nvlist_lookup_int32,
8       nvlist_lookup_int64,     nvlist_lookup_uint8,     nvlist_lookup_uint16,
9       nvlist_lookup_uint32,    nvlist_lookup_uint64,    nvlist_lookup_string,
10       nvlist_lookup_nvlist,                      nvlist_lookup_boolean_array,
11       nvlist_lookup_byte_array,                     nvlist_lookup_int8_array,
12       nvlist_lookup_int16_array,                   nvlist_lookup_int32_array,
13       nvlist_lookup_int64_array,                   nvlist_lookup_uint8_array,
14       nvlist_lookup_uint16_array,                 nvlist_lookup_uint32_array,
15       nvlist_lookup_uint64_array,                 nvlist_lookup_string_array,
16       nvlist_lookup_nvlist_array,  nvlist_lookup_pairs  - match name and type
17       indicated by the interface name and retrieve data value
18

SYNOPSIS

20       #include <sys/nvpair.h>
21
22       int nvlist_lookup_boolean(nvlist_t *nvl, const char *name);
23
24
25       int nvlist_lookup_boolean_value(nvlist_t *nvl, const char *name,
26            boolean_t *val);
27
28
29       int nvlist_lookup_byte(nvlist_t *nvl, const char *name,
30            uchar_t *val);
31
32
33       int nvlist_lookup_int8(nvlist_t *nvl, const char *name,
34            int8_t *val);
35
36
37       int nvlist_lookup_uint8(nvlist_t *nvl, const char *name,
38            uint8_t *val);
39
40
41       int nvlist_lookup_int16(nvlist_t *nvl, const char *name,
42            int16_t *val);
43
44
45       int nvlist_lookup_uint16(nvlist_t *nvl, const char *name,
46            uint16_t *val);
47
48
49       int nvlist_lookup_int32(nvlist_t *nvl, const char *name,
50            int32_t *val);
51
52
53       int nvlist_lookup_uint32(nvlist_t *nvl, const char *name,
54            uint32_t *val);
55
56
57       int nvlist_lookup_int64(nvlist_t *nvl, const char *name,
58            int64_t *val);
59
60
61       int nvlist_lookup_uint64(nvlist_t *nvl, const char *name,
62            uint64_t *val);
63
64
65       int nvlist_lookup_string(nvlist_t *nvl, const char *name,
66            char **val);
67
68
69       int nvlist_lookup_nvlist(nvlist_t *nvl, const char *name,
70            nvlist_t **val);
71
72
73       int nvlist_lookup_boolean_array(nvlist_t *nvl, const char *name,
74            boolean_t **val, uint_t *nelem);
75
76
77       int nvlist_lookup_byte_array(nvlist_t *nvl, const char *name,
78            uchar_t **val, uint_t *nelem);
79
80
81       int nvlist_lookup_int8_array(nvlist_t *nvl, const char *name,
82            int8_t **val, uint_t *nelem);
83
84
85       int nvlist_lookup_uint8_array(nvlist_t *nvl, const char *name,
86            uint8_t **val, uint_t *nelem);
87
88
89       int nvlist_lookup_int16_array(nvlist_t *nvl, const char *name,
90            int16_t **val, uint_t *nelem);
91
92
93       int nvlist_lookup_uint16_array(nvlist_t *nvl, const char *name,
94            uint16_t **val, uint_t *nelem);
95
96
97       int nvlist_lookup_int32_array(nvlist_t *nvl, const char *name,
98            int32_t **val, uint_t *nelem);
99
100
101       int nvlist_lookup_uint32_array(nvlist_t *nvl, const char *name,
102            uint32_t **val, uint_t *nelem);
103
104
105       int nvlist_lookup_int64_array(nvlist_t *nvl, const char *name,
106            int64_t **val, uint_t *nelem);
107
108
109       int nvlist_lookup_uint64_array(nvlist_t *nvl, const char *name,
110            uint64_t **val, uint_t *nelem);
111
112
113       int nvlist_lookup_string_array(nvlist_t *nvl, const char *name,
114            char  ***val, uint_t *nelem);
115
116
117       int nvlist_lookup_nvlist_array(nvlist_t *nvl, const char *name,
118            nvlist_t ***val, uint_t *nelem);
119
120
121       int nvlist_lookup_pairs(nvlist_t *nvl, int flag, ...);
122
123

INTERFACE LEVEL

125       Solaris DDI specific (Solaris DDI)
126

PARAMETERS

128       nvl      The list of name-value pairs (nvlist_t) to be processed.
129
130
131       name     Name of the name-value pair (nvpair) to search.
132
133
134       nelem    Address to store the number of elements in value.
135
136
137       val      Address to store the value or starting address  of  the  array
138                value.
139
140
141       flag     Specify bit fields defining lookup behavior:
142
143                NV_FLAG_NOENTOK    The  retrival  function will not fail if no
144                                   matching name-value pair is found.
145
146
147

DESCRIPTION

149       These functions find the nvpair that matches the name and type as indi‐
150       cated  by  the interface name. If one is found, nelem and val are modi‐
151       fied to contain the number  of  elements  in  value  and  the  starting
152       address of data, respectively.
153
154
155       These  interfaces  work  for  nvlist_t allocated with NV_UNIQUE_NAME or
156       NV_UNIQUE_NAME_TYPE specified in nvlist_alloc(). See  nvlist_alloc(9F).
157       If  this is not the case, the interface will return ENOTSUP because the
158       list potentially contains multiple nvpairs with the same name and type.
159
160
161       Multiple threads can simultaneously read the same nvlist_t but only one
162       thread should actively change a given nvlist_t at a time. The caller is
163       responsible for the synchronization.
164
165
166       All memory required for storing the array  elements,  including  string
167       values,  are  managed  by  the  library. References to such data remain
168       valid until nvlist_free() is called on nvl.
169
170
171       The nvlist_lookup_pairs() function retrieves  a  set  of  nvpairs.  The
172       arguments   are   a   null-terminated   list   of   pairs   (data  type
173       DATA_TYPE_BOOLEAN), triples (non-array data types) or quads (array data
174       types).  As shown below, the interpretation of the arguments depends on
175       the value of type. See nvpair_type(9F).
176
177       name     Name of the name-value pair to search.
178
179
180       type     Data type.
181
182
183       val      Address to store the starting address of the value. When using
184                data type DATA_TYPE_BOOLEAN, the val argument is ignored.
185
186
187       nelem    Address  to  store  the number of elements in value. Non-array
188                data types have only one argument and nelem is ignored.
189
190
191
192       The argument order is name, type, [val], [nelem].
193
194
195       When using NV_FLAG_NOENTOK and no matching name-value  pair  is  found,
196       the memory pointed to by val and nelem is not touched.
197
198
199       These functions return 0 on success and an error value on failure.
200

ERRORS

202       These functions fail under the following conditions.
203
204       0          Success
205
206
207       EINVAL     Invalid argument
208
209
210       ENOENT     No matching name-value pair found
211
212
213       ENOTSUP    Encode/decode method not supported
214
215

CONTEXT

217       These functions can be called from user, interrupt, or kernel context.
218

ATTRIBUTES

220       See attributes(5) for descriptions of the following attributes:
221
222
223
224
225       ┌─────────────────────────────┬─────────────────────────────┐
226       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
227       ├─────────────────────────────┼─────────────────────────────┤
228       │Interface Stability          │Committed                    │
229       └─────────────────────────────┴─────────────────────────────┘
230

SEE ALSO

232       nvlist_alloc(9F), nvpair_type(9F)
233
234
235       Writing Device Drivers
236
237
238       STREAMS Programming Guide
239
240
241
242SunOS 5.11                        20 May 2006        nvlist_lookup_boolean(9F)
Impressum