1 module symmetry.api.libzfs_core;
2 
3 
4         import core.stdc.config;
5         import core.stdc.stdarg: va_list;
6         static import core.simd;
7 
8         template __from(string moduleName) {
9             mixin("import from = " ~ moduleName ~ ";");
10         }
11         struct DppOffsetSize{ long offset; long size; }
12         struct Int128 { long lower; long upper; }
13         struct UInt128 { ulong lower; ulong upper; }
14 
15         struct __locale_data { int dummy; }
16 
17 
18 alias _Bool = bool;
19 struct dpp {
20 
21     static bool isEmpty(T)() {
22         return T.tupleof.length == 0;
23     }
24     static struct Move(T) {
25         T* ptr;
26     }
27 
28     static auto move(T)(ref T value) {
29         return Move!T(&value);
30     }
31     mixin template EnumD(string name, T, string prefix) if(is(T == enum)) {
32         private static string _memberMixinStr(string member) {
33             import std.conv: text;
34             import std.array: replace;
35             return text(` `, member.replace(prefix, ""), ` = `, T.stringof, `.`, member, `,`);
36         }
37         private static string _enumMixinStr() {
38             import std.array: join;
39             string[] ret;
40             ret ~= "enum " ~ name ~ "{";
41             static foreach(member; __traits(allMembers, T)) {
42                 ret ~= _memberMixinStr(member);
43             }
44             ret ~= "}";
45             return ret.join("\n");
46         }
47         mixin(_enumMixinStr());
48     }
49 }
50 
51 extern(C)
52 {
53     enum zio_priority
54     {
55         ZIO_PRIORITY_SYNC_READ = 0,
56         ZIO_PRIORITY_SYNC_WRITE = 1,
57         ZIO_PRIORITY_ASYNC_READ = 2,
58         ZIO_PRIORITY_ASYNC_WRITE = 3,
59         ZIO_PRIORITY_SCRUB = 4,
60         ZIO_PRIORITY_REMOVAL = 5,
61         ZIO_PRIORITY_INITIALIZING = 6,
62         ZIO_PRIORITY_TRIM = 7,
63         ZIO_PRIORITY_NUM_QUEUEABLE = 8,
64         ZIO_PRIORITY_NOW = 9,
65     }
66     enum ZIO_PRIORITY_SYNC_READ = zio_priority.ZIO_PRIORITY_SYNC_READ;
67     enum ZIO_PRIORITY_SYNC_WRITE = zio_priority.ZIO_PRIORITY_SYNC_WRITE;
68     enum ZIO_PRIORITY_ASYNC_READ = zio_priority.ZIO_PRIORITY_ASYNC_READ;
69     enum ZIO_PRIORITY_ASYNC_WRITE = zio_priority.ZIO_PRIORITY_ASYNC_WRITE;
70     enum ZIO_PRIORITY_SCRUB = zio_priority.ZIO_PRIORITY_SCRUB;
71     enum ZIO_PRIORITY_REMOVAL = zio_priority.ZIO_PRIORITY_REMOVAL;
72     enum ZIO_PRIORITY_INITIALIZING = zio_priority.ZIO_PRIORITY_INITIALIZING;
73     enum ZIO_PRIORITY_TRIM = zio_priority.ZIO_PRIORITY_TRIM;
74     enum ZIO_PRIORITY_NUM_QUEUEABLE = zio_priority.ZIO_PRIORITY_NUM_QUEUEABLE;
75     enum ZIO_PRIORITY_NOW = zio_priority.ZIO_PRIORITY_NOW;
76     alias zio_priority_t = zio_priority;
77     nvlist* fnvpair_value_nvlist(nvpair*) @nogc nothrow;
78     char* fnvpair_value_string(nvpair*) @nogc nothrow;
79     ulong fnvpair_value_uint64(nvpair*) @nogc nothrow;
80     uint fnvpair_value_uint32(nvpair*) @nogc nothrow;
81     ushort fnvpair_value_uint16(nvpair*) @nogc nothrow;
82     ubyte fnvpair_value_uint8(nvpair*) @nogc nothrow;
83     c_long fnvpair_value_int64(nvpair*) @nogc nothrow;
84     int fnvpair_value_int32(nvpair*) @nogc nothrow;
85     short fnvpair_value_int16(nvpair*) @nogc nothrow;
86     byte fnvpair_value_int8(nvpair*) @nogc nothrow;
87     ubyte fnvpair_value_byte(nvpair*) @nogc nothrow;
88     int fnvpair_value_boolean_value(nvpair*) @nogc nothrow;
89     ulong* fnvlist_lookup_uint64_array(nvlist*, const(char)*, uint*) @nogc nothrow;
90     c_long* fnvlist_lookup_int64_array(nvlist*, const(char)*, uint*) @nogc nothrow;
91     uint* fnvlist_lookup_uint32_array(nvlist*, const(char)*, uint*) @nogc nothrow;
92     int* fnvlist_lookup_int32_array(nvlist*, const(char)*, uint*) @nogc nothrow;
93     ushort* fnvlist_lookup_uint16_array(nvlist*, const(char)*, uint*) @nogc nothrow;
94     short* fnvlist_lookup_int16_array(nvlist*, const(char)*, uint*) @nogc nothrow;
95     ubyte* fnvlist_lookup_uint8_array(nvlist*, const(char)*, uint*) @nogc nothrow;
96     byte* fnvlist_lookup_int8_array(nvlist*, const(char)*, uint*) @nogc nothrow;
97     ubyte* fnvlist_lookup_byte_array(nvlist*, const(char)*, uint*) @nogc nothrow;
98     int* fnvlist_lookup_boolean_array(nvlist*, const(char)*, uint*) @nogc nothrow;
99     nvlist* fnvlist_lookup_nvlist(nvlist*, const(char)*) @nogc nothrow;
100     char* fnvlist_lookup_string(nvlist*, const(char)*) @nogc nothrow;
101     ulong fnvlist_lookup_uint64(nvlist*, const(char)*) @nogc nothrow;
102     uint fnvlist_lookup_uint32(nvlist*, const(char)*) @nogc nothrow;
103     ushort fnvlist_lookup_uint16(nvlist*, const(char)*) @nogc nothrow;
104     ubyte fnvlist_lookup_uint8(nvlist*, const(char)*) @nogc nothrow;
105     c_long fnvlist_lookup_int64(nvlist*, const(char)*) @nogc nothrow;
106     int fnvlist_lookup_int32(nvlist*, const(char)*) @nogc nothrow;
107     short fnvlist_lookup_int16(nvlist*, const(char)*) @nogc nothrow;
108     byte fnvlist_lookup_int8(nvlist*, const(char)*) @nogc nothrow;
109     ubyte fnvlist_lookup_byte(nvlist*, const(char)*) @nogc nothrow;
110     int fnvlist_lookup_boolean_value(nvlist*, const(char)*) @nogc nothrow;
111     int fnvlist_lookup_boolean(nvlist*, const(char)*) @nogc nothrow;
112     nvpair* fnvlist_lookup_nvpair(nvlist*, const(char)*) @nogc nothrow;
113     void fnvlist_remove_nvpair(nvlist*, nvpair*) @nogc nothrow;
114     void fnvlist_remove(nvlist*, const(char)*) @nogc nothrow;
115     void fnvlist_add_nvlist_array(nvlist*, const(char)*, nvlist**, uint) @nogc nothrow;
116     void fnvlist_add_string_array(nvlist*, const(char)*, char**, uint) @nogc nothrow;
117     void fnvlist_add_uint64_array(nvlist*, const(char)*, ulong*, uint) @nogc nothrow;
118     void fnvlist_add_int64_array(nvlist*, const(char)*, c_long*, uint) @nogc nothrow;
119     void fnvlist_add_uint32_array(nvlist*, const(char)*, uint*, uint) @nogc nothrow;
120     void fnvlist_add_int32_array(nvlist*, const(char)*, int*, uint) @nogc nothrow;
121     void fnvlist_add_uint16_array(nvlist*, const(char)*, ushort*, uint) @nogc nothrow;
122     void fnvlist_add_int16_array(nvlist*, const(char)*, short*, uint) @nogc nothrow;
123     void fnvlist_add_uint8_array(nvlist*, const(char)*, ubyte*, uint) @nogc nothrow;
124     void fnvlist_add_int8_array(nvlist*, const(char)*, byte*, uint) @nogc nothrow;
125     void fnvlist_add_byte_array(nvlist*, const(char)*, ubyte*, uint) @nogc nothrow;
126     void fnvlist_add_boolean_array(nvlist*, const(char)*, int*, uint) @nogc nothrow;
127     void fnvlist_add_nvpair(nvlist*, nvpair*) @nogc nothrow;
128     void fnvlist_add_nvlist(nvlist*, const(char)*, nvlist*) @nogc nothrow;
129     void fnvlist_add_string(nvlist*, const(char)*, const(char)*) @nogc nothrow;
130     void fnvlist_add_uint64(nvlist*, const(char)*, ulong) @nogc nothrow;
131     void fnvlist_add_int64(nvlist*, const(char)*, c_long) @nogc nothrow;
132     void fnvlist_add_uint32(nvlist*, const(char)*, uint) @nogc nothrow;
133     void fnvlist_add_int32(nvlist*, const(char)*, int) @nogc nothrow;
134     void fnvlist_add_uint16(nvlist*, const(char)*, ushort) @nogc nothrow;
135     void fnvlist_add_int16(nvlist*, const(char)*, short) @nogc nothrow;
136     void fnvlist_add_uint8(nvlist*, const(char)*, ubyte) @nogc nothrow;
137     void fnvlist_add_int8(nvlist*, const(char)*, byte) @nogc nothrow;
138     void fnvlist_add_byte(nvlist*, const(char)*, ubyte) @nogc nothrow;
139     void fnvlist_add_boolean_value(nvlist*, const(char)*, int) @nogc nothrow;
140     void fnvlist_add_boolean(nvlist*, const(char)*) @nogc nothrow;
141     c_ulong fnvlist_num_pairs(nvlist*) @nogc nothrow;
142     void fnvlist_merge(nvlist*, nvlist*) @nogc nothrow;
143     nvlist* fnvlist_dup(nvlist*) @nogc nothrow;
144     nvlist* fnvlist_unpack(char*, c_ulong) @nogc nothrow;
145     void fnvlist_pack_free(char*, c_ulong) @nogc nothrow;
146     char* fnvlist_pack(nvlist*, c_ulong*) @nogc nothrow;
147     c_ulong fnvlist_size(nvlist*) @nogc nothrow;
148     void fnvlist_free(nvlist*) @nogc nothrow;
149     nvlist* fnvlist_alloc() @nogc nothrow;
150     int nvpair_value_double(nvpair*, double*) @nogc nothrow;
151     int nvpair_value_hrtime(nvpair*, ulong*) @nogc nothrow;
152     int nvpair_value_nvlist_array(nvpair*, nvlist***, uint*) @nogc nothrow;
153     int nvpair_value_string_array(nvpair*, char***, uint*) @nogc nothrow;
154     int nvpair_value_uint64_array(nvpair*, ulong**, uint*) @nogc nothrow;
155     int nvpair_value_int64_array(nvpair*, c_long**, uint*) @nogc nothrow;
156     int nvpair_value_uint32_array(nvpair*, uint**, uint*) @nogc nothrow;
157     int nvpair_value_int32_array(nvpair*, int**, uint*) @nogc nothrow;
158     int nvpair_value_uint16_array(nvpair*, ushort**, uint*) @nogc nothrow;
159     int nvpair_value_int16_array(nvpair*, short**, uint*) @nogc nothrow;
160     int nvpair_value_uint8_array(nvpair*, ubyte**, uint*) @nogc nothrow;
161     int nvpair_value_int8_array(nvpair*, byte**, uint*) @nogc nothrow;
162     int nvpair_value_byte_array(nvpair*, ubyte**, uint*) @nogc nothrow;
163     int nvpair_value_boolean_array(nvpair*, int**, uint*) @nogc nothrow;
164     int nvpair_value_nvlist(nvpair*, nvlist**) @nogc nothrow;
165     int nvpair_value_string(nvpair*, char**) @nogc nothrow;
166     int nvpair_value_uint64(nvpair*, ulong*) @nogc nothrow;
167     int nvpair_value_int64(nvpair*, c_long*) @nogc nothrow;
168     int nvpair_value_uint32(nvpair*, uint*) @nogc nothrow;
169     int nvpair_value_int32(nvpair*, int*) @nogc nothrow;
170     int nvpair_value_uint16(nvpair*, ushort*) @nogc nothrow;
171     int nvpair_value_int16(nvpair*, short*) @nogc nothrow;
172     int nvpair_value_uint8(nvpair*, ubyte*) @nogc nothrow;
173     int nvpair_value_int8(nvpair*, byte*) @nogc nothrow;
174     int nvpair_value_byte(nvpair*, ubyte*) @nogc nothrow;
175     int nvpair_value_boolean_value(nvpair*, int*) @nogc nothrow;
176     int nvpair_type_is_array(nvpair*) @nogc nothrow;
177     data_type_t nvpair_type(nvpair*) @nogc nothrow;
178     char* nvpair_name(nvpair*) @nogc nothrow;
179     nvpair* nvlist_prev_nvpair(nvlist*, nvpair*) @nogc nothrow;
180     nvpair* nvlist_next_nvpair(nvlist*, nvpair*) @nogc nothrow;
181     int nvlist_empty(nvlist*) @nogc nothrow;
182     int nvlist_exists(nvlist*, const(char)*) @nogc nothrow;
183     int nvlist_lookup_nvpair_embedded_index(nvlist*, const(char)*, nvpair**, int*, char**) @nogc nothrow;
184     int nvlist_lookup_nvpair(nvlist*, const(char)*, nvpair**) @nogc nothrow;
185     int nvlist_lookup_double(nvlist*, const(char)*, double*) @nogc nothrow;
186     int nvlist_lookup_pairs(nvlist*, int, ...) @nogc nothrow;
187     int nvlist_lookup_hrtime(nvlist*, const(char)*, ulong*) @nogc nothrow;
188     int nvlist_lookup_nvlist_array(nvlist*, const(char)*, nvlist***, uint*) @nogc nothrow;
189     int nvlist_lookup_string_array(nvlist*, const(char)*, char***, uint*) @nogc nothrow;
190     int nvlist_lookup_uint64_array(nvlist*, const(char)*, ulong**, uint*) @nogc nothrow;
191     int nvlist_lookup_int64_array(nvlist*, const(char)*, c_long**, uint*) @nogc nothrow;
192     int nvlist_lookup_uint32_array(nvlist*, const(char)*, uint**, uint*) @nogc nothrow;
193     int nvlist_lookup_int32_array(nvlist*, const(char)*, int**, uint*) @nogc nothrow;
194     int nvlist_lookup_uint16_array(nvlist*, const(char)*, ushort**, uint*) @nogc nothrow;
195     int nvlist_lookup_int16_array(nvlist*, const(char)*, short**, uint*) @nogc nothrow;
196     int nvlist_lookup_uint8_array(nvlist*, const(char)*, ubyte**, uint*) @nogc nothrow;
197     int nvlist_lookup_int8_array(nvlist*, const(char)*, byte**, uint*) @nogc nothrow;
198     int nvlist_lookup_byte_array(nvlist*, const(char)*, ubyte**, uint*) @nogc nothrow;
199     int nvlist_lookup_boolean_array(nvlist*, const(char)*, int**, uint*) @nogc nothrow;
200     int nvlist_lookup_nvlist(nvlist*, const(char)*, nvlist**) @nogc nothrow;
201     int nvlist_lookup_string(nvlist*, const(char)*, char**) @nogc nothrow;
202     int nvlist_lookup_uint64(nvlist*, const(char)*, ulong*) @nogc nothrow;
203     int nvlist_lookup_int64(nvlist*, const(char)*, c_long*) @nogc nothrow;
204     int nvlist_lookup_uint32(nvlist*, const(char)*, uint*) @nogc nothrow;
205     int nvlist_lookup_int32(nvlist*, const(char)*, int*) @nogc nothrow;
206     int nvlist_lookup_uint16(nvlist*, const(char)*, ushort*) @nogc nothrow;
207     int nvlist_lookup_int16(nvlist*, const(char)*, short*) @nogc nothrow;
208     int nvlist_lookup_uint8(nvlist*, const(char)*, ubyte*) @nogc nothrow;
209     int nvlist_lookup_int8(nvlist*, const(char)*, byte*) @nogc nothrow;
210     int nvlist_lookup_byte(nvlist*, const(char)*, ubyte*) @nogc nothrow;
211     int nvlist_lookup_boolean_value(nvlist*, const(char)*, int*) @nogc nothrow;
212     int nvlist_lookup_boolean(nvlist*, const(char)*) @nogc nothrow;
213     int nvlist_remove_nvpair(nvlist*, nvpair*) @nogc nothrow;
214     int nvlist_remove_all(nvlist*, const(char)*) @nogc nothrow;
215     int nvlist_remove(nvlist*, const(char)*, data_type_t) @nogc nothrow;
216     int nvlist_add_double(nvlist*, const(char)*, double) @nogc nothrow;
217     int nvlist_add_hrtime(nvlist*, const(char)*, ulong) @nogc nothrow;
218     int nvlist_add_nvlist_array(nvlist*, const(char)*, nvlist**, uint) @nogc nothrow;
219     int nvlist_add_string_array(nvlist*, const(char)*, char**, uint) @nogc nothrow;
220     int nvlist_add_uint64_array(nvlist*, const(char)*, ulong*, uint) @nogc nothrow;
221     int nvlist_add_int64_array(nvlist*, const(char)*, c_long*, uint) @nogc nothrow;
222     int nvlist_add_uint32_array(nvlist*, const(char)*, uint*, uint) @nogc nothrow;
223     int nvlist_add_int32_array(nvlist*, const(char)*, int*, uint) @nogc nothrow;
224     int nvlist_add_uint16_array(nvlist*, const(char)*, ushort*, uint) @nogc nothrow;
225     int nvlist_add_int16_array(nvlist*, const(char)*, short*, uint) @nogc nothrow;
226     int nvlist_add_uint8_array(nvlist*, const(char)*, ubyte*, uint) @nogc nothrow;
227     int nvlist_add_int8_array(nvlist*, const(char)*, byte*, uint) @nogc nothrow;
228     int nvlist_add_byte_array(nvlist*, const(char)*, ubyte*, uint) @nogc nothrow;
229     int nvlist_add_boolean_array(nvlist*, const(char)*, int*, uint) @nogc nothrow;
230     int nvlist_add_nvlist(nvlist*, const(char)*, nvlist*) @nogc nothrow;
231     int nvlist_add_string(nvlist*, const(char)*, const(char)*) @nogc nothrow;
232     int nvlist_add_uint64(nvlist*, const(char)*, ulong) @nogc nothrow;
233     int nvlist_add_int64(nvlist*, const(char)*, c_long) @nogc nothrow;
234     int nvlist_add_uint32(nvlist*, const(char)*, uint) @nogc nothrow;
235     int nvlist_add_int32(nvlist*, const(char)*, int) @nogc nothrow;
236     int nvlist_add_uint16(nvlist*, const(char)*, ushort) @nogc nothrow;
237     int nvlist_add_int16(nvlist*, const(char)*, short) @nogc nothrow;
238     int nvlist_add_uint8(nvlist*, const(char)*, ubyte) @nogc nothrow;
239     int nvlist_add_int8(nvlist*, const(char)*, byte) @nogc nothrow;
240     int nvlist_add_byte(nvlist*, const(char)*, ubyte) @nogc nothrow;
241     int nvlist_add_boolean_value(nvlist*, const(char)*, int) @nogc nothrow;
242     int nvlist_add_boolean(nvlist*, const(char)*) @nogc nothrow;
243     int nvlist_add_nvpair(nvlist*, nvpair*) @nogc nothrow;
244     nv_alloc* nvlist_lookup_nv_alloc(nvlist*) @nogc nothrow;
245     int nvlist_xdup(nvlist*, nvlist**, nv_alloc*) @nogc nothrow;
246     int nvlist_xunpack(char*, c_ulong, nvlist**, nv_alloc*) @nogc nothrow;
247     int nvlist_xpack(nvlist*, char**, c_ulong*, int, nv_alloc*) @nogc nothrow;
248     int nvlist_xalloc(nvlist**, uint, nv_alloc*) @nogc nothrow;
249     uint nvlist_nvflag(nvlist*) @nogc nothrow;
250     int nvlist_merge(nvlist*, nvlist*, int) @nogc nothrow;
251     int nvlist_dup(nvlist*, nvlist**, int) @nogc nothrow;
252     int nvlist_unpack(char*, c_ulong, nvlist**, int) @nogc nothrow;
253     int nvlist_pack(nvlist*, char**, c_ulong*, int, int) @nogc nothrow;
254     int nvlist_size(nvlist*, c_ulong*, int) @nogc nothrow;
255     void nvlist_free(nvlist*) @nogc nothrow;
256     int nvlist_alloc(nvlist**, uint, int) @nogc nothrow;
257     void nv_alloc_fini(nv_alloc*) @nogc nothrow;
258     void nv_alloc_reset(nv_alloc*) @nogc nothrow;
259     int nv_alloc_init(nv_alloc*, const(nv_alloc_ops)*, ...) @nogc nothrow;
260     extern __gshared nv_alloc* nv_alloc_nosleep;
261     extern __gshared const(nv_alloc_ops)* nv_fixed_ops;
262     struct nv_alloc
263     {
264         @DppOffsetSize(0,8) const(nv_alloc_ops)* nva_ops;
265         @DppOffsetSize(8,8) void* nva_arg;
266     }
267     alias nv_alloc_t = nv_alloc;
268     struct nv_alloc_ops
269     {
270         @DppOffsetSize(0,8) int function(nv_alloc*, int) nv_ao_init;
271         @DppOffsetSize(8,8) void function(nv_alloc*) nv_ao_fini;
272         @DppOffsetSize(16,8) void* function(nv_alloc*, c_ulong) nv_ao_alloc;
273         @DppOffsetSize(24,8) void function(nv_alloc*, void*, c_ulong) nv_ao_free;
274         @DppOffsetSize(32,8) void function(nv_alloc*) nv_ao_reset;
275     }
276     alias nv_alloc_ops_t = nv_alloc_ops;
277     struct nvlist
278     {
279         @DppOffsetSize(0,4) int nvl_version;
280         @DppOffsetSize(4,4) uint nvl_nvflag;
281         @DppOffsetSize(8,8) ulong nvl_priv;
282         @DppOffsetSize(16,4) uint nvl_flag;
283         @DppOffsetSize(20,4) int nvl_pad;
284     }
285     alias nvlist_t = nvlist;
286     struct nvpair
287     {
288         @DppOffsetSize(0,4) int nvp_size;
289         @DppOffsetSize(4,2) short nvp_name_sz;
290         @DppOffsetSize(6,2) short nvp_reserve;
291         @DppOffsetSize(8,4) int nvp_value_elem;
292         @DppOffsetSize(12,4) data_type_t nvp_type;
293     }
294     alias nvpair_t = nvpair;
295     enum _Anonymous_0
296     {
297         DATA_TYPE_DONTCARE = -1,
298         DATA_TYPE_UNKNOWN = 0,
299         DATA_TYPE_BOOLEAN = 1,
300         DATA_TYPE_BYTE = 2,
301         DATA_TYPE_INT16 = 3,
302         DATA_TYPE_UINT16 = 4,
303         DATA_TYPE_INT32 = 5,
304         DATA_TYPE_UINT32 = 6,
305         DATA_TYPE_INT64 = 7,
306         DATA_TYPE_UINT64 = 8,
307         DATA_TYPE_STRING = 9,
308         DATA_TYPE_BYTE_ARRAY = 10,
309         DATA_TYPE_INT16_ARRAY = 11,
310         DATA_TYPE_UINT16_ARRAY = 12,
311         DATA_TYPE_INT32_ARRAY = 13,
312         DATA_TYPE_UINT32_ARRAY = 14,
313         DATA_TYPE_INT64_ARRAY = 15,
314         DATA_TYPE_UINT64_ARRAY = 16,
315         DATA_TYPE_STRING_ARRAY = 17,
316         DATA_TYPE_HRTIME = 18,
317         DATA_TYPE_NVLIST = 19,
318         DATA_TYPE_NVLIST_ARRAY = 20,
319         DATA_TYPE_BOOLEAN_VALUE = 21,
320         DATA_TYPE_INT8 = 22,
321         DATA_TYPE_UINT8 = 23,
322         DATA_TYPE_BOOLEAN_ARRAY = 24,
323         DATA_TYPE_INT8_ARRAY = 25,
324         DATA_TYPE_UINT8_ARRAY = 26,
325         DATA_TYPE_DOUBLE = 27,
326     }
327     enum DATA_TYPE_DONTCARE = _Anonymous_0.DATA_TYPE_DONTCARE;
328     enum DATA_TYPE_UNKNOWN = _Anonymous_0.DATA_TYPE_UNKNOWN;
329     enum DATA_TYPE_BOOLEAN = _Anonymous_0.DATA_TYPE_BOOLEAN;
330     enum DATA_TYPE_BYTE = _Anonymous_0.DATA_TYPE_BYTE;
331     enum DATA_TYPE_INT16 = _Anonymous_0.DATA_TYPE_INT16;
332     enum DATA_TYPE_UINT16 = _Anonymous_0.DATA_TYPE_UINT16;
333     enum DATA_TYPE_INT32 = _Anonymous_0.DATA_TYPE_INT32;
334     enum DATA_TYPE_UINT32 = _Anonymous_0.DATA_TYPE_UINT32;
335     enum DATA_TYPE_INT64 = _Anonymous_0.DATA_TYPE_INT64;
336     enum DATA_TYPE_UINT64 = _Anonymous_0.DATA_TYPE_UINT64;
337     enum DATA_TYPE_STRING = _Anonymous_0.DATA_TYPE_STRING;
338     enum DATA_TYPE_BYTE_ARRAY = _Anonymous_0.DATA_TYPE_BYTE_ARRAY;
339     enum DATA_TYPE_INT16_ARRAY = _Anonymous_0.DATA_TYPE_INT16_ARRAY;
340     enum DATA_TYPE_UINT16_ARRAY = _Anonymous_0.DATA_TYPE_UINT16_ARRAY;
341     enum DATA_TYPE_INT32_ARRAY = _Anonymous_0.DATA_TYPE_INT32_ARRAY;
342     enum DATA_TYPE_UINT32_ARRAY = _Anonymous_0.DATA_TYPE_UINT32_ARRAY;
343     enum DATA_TYPE_INT64_ARRAY = _Anonymous_0.DATA_TYPE_INT64_ARRAY;
344     enum DATA_TYPE_UINT64_ARRAY = _Anonymous_0.DATA_TYPE_UINT64_ARRAY;
345     enum DATA_TYPE_STRING_ARRAY = _Anonymous_0.DATA_TYPE_STRING_ARRAY;
346     enum DATA_TYPE_HRTIME = _Anonymous_0.DATA_TYPE_HRTIME;
347     enum DATA_TYPE_NVLIST = _Anonymous_0.DATA_TYPE_NVLIST;
348     enum DATA_TYPE_NVLIST_ARRAY = _Anonymous_0.DATA_TYPE_NVLIST_ARRAY;
349     enum DATA_TYPE_BOOLEAN_VALUE = _Anonymous_0.DATA_TYPE_BOOLEAN_VALUE;
350     enum DATA_TYPE_INT8 = _Anonymous_0.DATA_TYPE_INT8;
351     enum DATA_TYPE_UINT8 = _Anonymous_0.DATA_TYPE_UINT8;
352     enum DATA_TYPE_BOOLEAN_ARRAY = _Anonymous_0.DATA_TYPE_BOOLEAN_ARRAY;
353     enum DATA_TYPE_INT8_ARRAY = _Anonymous_0.DATA_TYPE_INT8_ARRAY;
354     enum DATA_TYPE_UINT8_ARRAY = _Anonymous_0.DATA_TYPE_UINT8_ARRAY;
355     enum DATA_TYPE_DOUBLE = _Anonymous_0.DATA_TYPE_DOUBLE;
356     alias data_type_t = _Anonymous_0;
357     ulong gethrtime() @nogc nothrow;
358     alias hrtime_t = ulong;
359     alias int64_t = c_long;
360     alias int32_t = int;
361     alias int16_t = short;
362     alias uint64_t = ulong;
363     alias uint8_t = ubyte;
364     alias uchar_t = ubyte;
365     alias boolean_t = int;
366     alias uint_t = uint;
367     alias uint32_t = uint;
368     alias uint16_t = ushort;
369     enum _Anonymous_1
370     {
371         SPA_LOAD_NONE = 0,
372         SPA_LOAD_OPEN = 1,
373         SPA_LOAD_IMPORT = 2,
374         SPA_LOAD_TRYIMPORT = 3,
375         SPA_LOAD_RECOVER = 4,
376         SPA_LOAD_ERROR = 5,
377         SPA_LOAD_CREATE = 6,
378     }
379     enum SPA_LOAD_NONE = _Anonymous_1.SPA_LOAD_NONE;
380     enum SPA_LOAD_OPEN = _Anonymous_1.SPA_LOAD_OPEN;
381     enum SPA_LOAD_IMPORT = _Anonymous_1.SPA_LOAD_IMPORT;
382     enum SPA_LOAD_TRYIMPORT = _Anonymous_1.SPA_LOAD_TRYIMPORT;
383     enum SPA_LOAD_RECOVER = _Anonymous_1.SPA_LOAD_RECOVER;
384     enum SPA_LOAD_ERROR = _Anonymous_1.SPA_LOAD_ERROR;
385     enum SPA_LOAD_CREATE = _Anonymous_1.SPA_LOAD_CREATE;
386     alias spa_load_state_t = _Anonymous_1;
387     enum _Anonymous_2
388     {
389         ZFS_ERR_CHECKPOINT_EXISTS = 1024,
390         ZFS_ERR_DISCARDING_CHECKPOINT = 1025,
391         ZFS_ERR_NO_CHECKPOINT = 1026,
392         ZFS_ERR_DEVRM_IN_PROGRESS = 1027,
393         ZFS_ERR_VDEV_TOO_BIG = 1028,
394         ZFS_ERR_IOC_CMD_UNAVAIL = 1029,
395         ZFS_ERR_IOC_ARG_UNAVAIL = 1030,
396         ZFS_ERR_IOC_ARG_REQUIRED = 1031,
397         ZFS_ERR_IOC_ARG_BADTYPE = 1032,
398         ZFS_ERR_WRONG_PARENT = 1033,
399         ZFS_ERR_FROM_IVSET_GUID_MISSING = 1034,
400         ZFS_ERR_FROM_IVSET_GUID_MISMATCH = 1035,
401         ZFS_ERR_SPILL_BLOCK_FLAG_MISSING = 1036,
402     }
403     enum ZFS_ERR_CHECKPOINT_EXISTS = _Anonymous_2.ZFS_ERR_CHECKPOINT_EXISTS;
404     enum ZFS_ERR_DISCARDING_CHECKPOINT = _Anonymous_2.ZFS_ERR_DISCARDING_CHECKPOINT;
405     enum ZFS_ERR_NO_CHECKPOINT = _Anonymous_2.ZFS_ERR_NO_CHECKPOINT;
406     enum ZFS_ERR_DEVRM_IN_PROGRESS = _Anonymous_2.ZFS_ERR_DEVRM_IN_PROGRESS;
407     enum ZFS_ERR_VDEV_TOO_BIG = _Anonymous_2.ZFS_ERR_VDEV_TOO_BIG;
408     enum ZFS_ERR_IOC_CMD_UNAVAIL = _Anonymous_2.ZFS_ERR_IOC_CMD_UNAVAIL;
409     enum ZFS_ERR_IOC_ARG_UNAVAIL = _Anonymous_2.ZFS_ERR_IOC_ARG_UNAVAIL;
410     enum ZFS_ERR_IOC_ARG_REQUIRED = _Anonymous_2.ZFS_ERR_IOC_ARG_REQUIRED;
411     enum ZFS_ERR_IOC_ARG_BADTYPE = _Anonymous_2.ZFS_ERR_IOC_ARG_BADTYPE;
412     enum ZFS_ERR_WRONG_PARENT = _Anonymous_2.ZFS_ERR_WRONG_PARENT;
413     enum ZFS_ERR_FROM_IVSET_GUID_MISSING = _Anonymous_2.ZFS_ERR_FROM_IVSET_GUID_MISSING;
414     enum ZFS_ERR_FROM_IVSET_GUID_MISMATCH = _Anonymous_2.ZFS_ERR_FROM_IVSET_GUID_MISMATCH;
415     enum ZFS_ERR_SPILL_BLOCK_FLAG_MISSING = _Anonymous_2.ZFS_ERR_SPILL_BLOCK_FLAG_MISSING;
416     alias zfs_errno_t = _Anonymous_2;
417     enum zfs_ioc
418     {
419         ZFS_IOC_FIRST = 23040,
420         ZFS_IOC = 23040,
421         ZFS_IOC_POOL_CREATE = 23040,
422         ZFS_IOC_POOL_DESTROY = 23041,
423         ZFS_IOC_POOL_IMPORT = 23042,
424         ZFS_IOC_POOL_EXPORT = 23043,
425         ZFS_IOC_POOL_CONFIGS = 23044,
426         ZFS_IOC_POOL_STATS = 23045,
427         ZFS_IOC_POOL_TRYIMPORT = 23046,
428         ZFS_IOC_POOL_SCAN = 23047,
429         ZFS_IOC_POOL_FREEZE = 23048,
430         ZFS_IOC_POOL_UPGRADE = 23049,
431         ZFS_IOC_POOL_GET_HISTORY = 23050,
432         ZFS_IOC_VDEV_ADD = 23051,
433         ZFS_IOC_VDEV_REMOVE = 23052,
434         ZFS_IOC_VDEV_SET_STATE = 23053,
435         ZFS_IOC_VDEV_ATTACH = 23054,
436         ZFS_IOC_VDEV_DETACH = 23055,
437         ZFS_IOC_VDEV_SETPATH = 23056,
438         ZFS_IOC_VDEV_SETFRU = 23057,
439         ZFS_IOC_OBJSET_STATS = 23058,
440         ZFS_IOC_OBJSET_ZPLPROPS = 23059,
441         ZFS_IOC_DATASET_LIST_NEXT = 23060,
442         ZFS_IOC_SNAPSHOT_LIST_NEXT = 23061,
443         ZFS_IOC_SET_PROP = 23062,
444         ZFS_IOC_CREATE = 23063,
445         ZFS_IOC_DESTROY = 23064,
446         ZFS_IOC_ROLLBACK = 23065,
447         ZFS_IOC_RENAME = 23066,
448         ZFS_IOC_RECV = 23067,
449         ZFS_IOC_SEND = 23068,
450         ZFS_IOC_INJECT_FAULT = 23069,
451         ZFS_IOC_CLEAR_FAULT = 23070,
452         ZFS_IOC_INJECT_LIST_NEXT = 23071,
453         ZFS_IOC_ERROR_LOG = 23072,
454         ZFS_IOC_CLEAR = 23073,
455         ZFS_IOC_PROMOTE = 23074,
456         ZFS_IOC_SNAPSHOT = 23075,
457         ZFS_IOC_DSOBJ_TO_DSNAME = 23076,
458         ZFS_IOC_OBJ_TO_PATH = 23077,
459         ZFS_IOC_POOL_SET_PROPS = 23078,
460         ZFS_IOC_POOL_GET_PROPS = 23079,
461         ZFS_IOC_SET_FSACL = 23080,
462         ZFS_IOC_GET_FSACL = 23081,
463         ZFS_IOC_SHARE = 23082,
464         ZFS_IOC_INHERIT_PROP = 23083,
465         ZFS_IOC_SMB_ACL = 23084,
466         ZFS_IOC_USERSPACE_ONE = 23085,
467         ZFS_IOC_USERSPACE_MANY = 23086,
468         ZFS_IOC_USERSPACE_UPGRADE = 23087,
469         ZFS_IOC_HOLD = 23088,
470         ZFS_IOC_RELEASE = 23089,
471         ZFS_IOC_GET_HOLDS = 23090,
472         ZFS_IOC_OBJSET_RECVD_PROPS = 23091,
473         ZFS_IOC_VDEV_SPLIT = 23092,
474         ZFS_IOC_NEXT_OBJ = 23093,
475         ZFS_IOC_DIFF = 23094,
476         ZFS_IOC_TMP_SNAPSHOT = 23095,
477         ZFS_IOC_OBJ_TO_STATS = 23096,
478         ZFS_IOC_SPACE_WRITTEN = 23097,
479         ZFS_IOC_SPACE_SNAPS = 23098,
480         ZFS_IOC_DESTROY_SNAPS = 23099,
481         ZFS_IOC_POOL_REGUID = 23100,
482         ZFS_IOC_POOL_REOPEN = 23101,
483         ZFS_IOC_SEND_PROGRESS = 23102,
484         ZFS_IOC_LOG_HISTORY = 23103,
485         ZFS_IOC_SEND_NEW = 23104,
486         ZFS_IOC_SEND_SPACE = 23105,
487         ZFS_IOC_CLONE = 23106,
488         ZFS_IOC_BOOKMARK = 23107,
489         ZFS_IOC_GET_BOOKMARKS = 23108,
490         ZFS_IOC_DESTROY_BOOKMARKS = 23109,
491         ZFS_IOC_RECV_NEW = 23110,
492         ZFS_IOC_POOL_SYNC = 23111,
493         ZFS_IOC_CHANNEL_PROGRAM = 23112,
494         ZFS_IOC_LOAD_KEY = 23113,
495         ZFS_IOC_UNLOAD_KEY = 23114,
496         ZFS_IOC_CHANGE_KEY = 23115,
497         ZFS_IOC_REMAP = 23116,
498         ZFS_IOC_POOL_CHECKPOINT = 23117,
499         ZFS_IOC_POOL_DISCARD_CHECKPOINT = 23118,
500         ZFS_IOC_POOL_INITIALIZE = 23119,
501         ZFS_IOC_POOL_TRIM = 23120,
502         ZFS_IOC_LINUX = 23168,
503         ZFS_IOC_EVENTS_NEXT = 23169,
504         ZFS_IOC_EVENTS_CLEAR = 23170,
505         ZFS_IOC_EVENTS_SEEK = 23171,
506         ZFS_IOC_FREEBSD = 23232,
507         ZFS_IOC_LAST = 23233,
508     }
509     enum ZFS_IOC_FIRST = zfs_ioc.ZFS_IOC_FIRST;
510     enum ZFS_IOC = zfs_ioc.ZFS_IOC;
511     enum ZFS_IOC_POOL_CREATE = zfs_ioc.ZFS_IOC_POOL_CREATE;
512     enum ZFS_IOC_POOL_DESTROY = zfs_ioc.ZFS_IOC_POOL_DESTROY;
513     enum ZFS_IOC_POOL_IMPORT = zfs_ioc.ZFS_IOC_POOL_IMPORT;
514     enum ZFS_IOC_POOL_EXPORT = zfs_ioc.ZFS_IOC_POOL_EXPORT;
515     enum ZFS_IOC_POOL_CONFIGS = zfs_ioc.ZFS_IOC_POOL_CONFIGS;
516     enum ZFS_IOC_POOL_STATS = zfs_ioc.ZFS_IOC_POOL_STATS;
517     enum ZFS_IOC_POOL_TRYIMPORT = zfs_ioc.ZFS_IOC_POOL_TRYIMPORT;
518     enum ZFS_IOC_POOL_SCAN = zfs_ioc.ZFS_IOC_POOL_SCAN;
519     enum ZFS_IOC_POOL_FREEZE = zfs_ioc.ZFS_IOC_POOL_FREEZE;
520     enum ZFS_IOC_POOL_UPGRADE = zfs_ioc.ZFS_IOC_POOL_UPGRADE;
521     enum ZFS_IOC_POOL_GET_HISTORY = zfs_ioc.ZFS_IOC_POOL_GET_HISTORY;
522     enum ZFS_IOC_VDEV_ADD = zfs_ioc.ZFS_IOC_VDEV_ADD;
523     enum ZFS_IOC_VDEV_REMOVE = zfs_ioc.ZFS_IOC_VDEV_REMOVE;
524     enum ZFS_IOC_VDEV_SET_STATE = zfs_ioc.ZFS_IOC_VDEV_SET_STATE;
525     enum ZFS_IOC_VDEV_ATTACH = zfs_ioc.ZFS_IOC_VDEV_ATTACH;
526     enum ZFS_IOC_VDEV_DETACH = zfs_ioc.ZFS_IOC_VDEV_DETACH;
527     enum ZFS_IOC_VDEV_SETPATH = zfs_ioc.ZFS_IOC_VDEV_SETPATH;
528     enum ZFS_IOC_VDEV_SETFRU = zfs_ioc.ZFS_IOC_VDEV_SETFRU;
529     enum ZFS_IOC_OBJSET_STATS = zfs_ioc.ZFS_IOC_OBJSET_STATS;
530     enum ZFS_IOC_OBJSET_ZPLPROPS = zfs_ioc.ZFS_IOC_OBJSET_ZPLPROPS;
531     enum ZFS_IOC_DATASET_LIST_NEXT = zfs_ioc.ZFS_IOC_DATASET_LIST_NEXT;
532     enum ZFS_IOC_SNAPSHOT_LIST_NEXT = zfs_ioc.ZFS_IOC_SNAPSHOT_LIST_NEXT;
533     enum ZFS_IOC_SET_PROP = zfs_ioc.ZFS_IOC_SET_PROP;
534     enum ZFS_IOC_CREATE = zfs_ioc.ZFS_IOC_CREATE;
535     enum ZFS_IOC_DESTROY = zfs_ioc.ZFS_IOC_DESTROY;
536     enum ZFS_IOC_ROLLBACK = zfs_ioc.ZFS_IOC_ROLLBACK;
537     enum ZFS_IOC_RENAME = zfs_ioc.ZFS_IOC_RENAME;
538     enum ZFS_IOC_RECV = zfs_ioc.ZFS_IOC_RECV;
539     enum ZFS_IOC_SEND = zfs_ioc.ZFS_IOC_SEND;
540     enum ZFS_IOC_INJECT_FAULT = zfs_ioc.ZFS_IOC_INJECT_FAULT;
541     enum ZFS_IOC_CLEAR_FAULT = zfs_ioc.ZFS_IOC_CLEAR_FAULT;
542     enum ZFS_IOC_INJECT_LIST_NEXT = zfs_ioc.ZFS_IOC_INJECT_LIST_NEXT;
543     enum ZFS_IOC_ERROR_LOG = zfs_ioc.ZFS_IOC_ERROR_LOG;
544     enum ZFS_IOC_CLEAR = zfs_ioc.ZFS_IOC_CLEAR;
545     enum ZFS_IOC_PROMOTE = zfs_ioc.ZFS_IOC_PROMOTE;
546     enum ZFS_IOC_SNAPSHOT = zfs_ioc.ZFS_IOC_SNAPSHOT;
547     enum ZFS_IOC_DSOBJ_TO_DSNAME = zfs_ioc.ZFS_IOC_DSOBJ_TO_DSNAME;
548     enum ZFS_IOC_OBJ_TO_PATH = zfs_ioc.ZFS_IOC_OBJ_TO_PATH;
549     enum ZFS_IOC_POOL_SET_PROPS = zfs_ioc.ZFS_IOC_POOL_SET_PROPS;
550     enum ZFS_IOC_POOL_GET_PROPS = zfs_ioc.ZFS_IOC_POOL_GET_PROPS;
551     enum ZFS_IOC_SET_FSACL = zfs_ioc.ZFS_IOC_SET_FSACL;
552     enum ZFS_IOC_GET_FSACL = zfs_ioc.ZFS_IOC_GET_FSACL;
553     enum ZFS_IOC_SHARE = zfs_ioc.ZFS_IOC_SHARE;
554     enum ZFS_IOC_INHERIT_PROP = zfs_ioc.ZFS_IOC_INHERIT_PROP;
555     enum ZFS_IOC_SMB_ACL = zfs_ioc.ZFS_IOC_SMB_ACL;
556     enum ZFS_IOC_USERSPACE_ONE = zfs_ioc.ZFS_IOC_USERSPACE_ONE;
557     enum ZFS_IOC_USERSPACE_MANY = zfs_ioc.ZFS_IOC_USERSPACE_MANY;
558     enum ZFS_IOC_USERSPACE_UPGRADE = zfs_ioc.ZFS_IOC_USERSPACE_UPGRADE;
559     enum ZFS_IOC_HOLD = zfs_ioc.ZFS_IOC_HOLD;
560     enum ZFS_IOC_RELEASE = zfs_ioc.ZFS_IOC_RELEASE;
561     enum ZFS_IOC_GET_HOLDS = zfs_ioc.ZFS_IOC_GET_HOLDS;
562     enum ZFS_IOC_OBJSET_RECVD_PROPS = zfs_ioc.ZFS_IOC_OBJSET_RECVD_PROPS;
563     enum ZFS_IOC_VDEV_SPLIT = zfs_ioc.ZFS_IOC_VDEV_SPLIT;
564     enum ZFS_IOC_NEXT_OBJ = zfs_ioc.ZFS_IOC_NEXT_OBJ;
565     enum ZFS_IOC_DIFF = zfs_ioc.ZFS_IOC_DIFF;
566     enum ZFS_IOC_TMP_SNAPSHOT = zfs_ioc.ZFS_IOC_TMP_SNAPSHOT;
567     enum ZFS_IOC_OBJ_TO_STATS = zfs_ioc.ZFS_IOC_OBJ_TO_STATS;
568     enum ZFS_IOC_SPACE_WRITTEN = zfs_ioc.ZFS_IOC_SPACE_WRITTEN;
569     enum ZFS_IOC_SPACE_SNAPS = zfs_ioc.ZFS_IOC_SPACE_SNAPS;
570     enum ZFS_IOC_DESTROY_SNAPS = zfs_ioc.ZFS_IOC_DESTROY_SNAPS;
571     enum ZFS_IOC_POOL_REGUID = zfs_ioc.ZFS_IOC_POOL_REGUID;
572     enum ZFS_IOC_POOL_REOPEN = zfs_ioc.ZFS_IOC_POOL_REOPEN;
573     enum ZFS_IOC_SEND_PROGRESS = zfs_ioc.ZFS_IOC_SEND_PROGRESS;
574     enum ZFS_IOC_LOG_HISTORY = zfs_ioc.ZFS_IOC_LOG_HISTORY;
575     enum ZFS_IOC_SEND_NEW = zfs_ioc.ZFS_IOC_SEND_NEW;
576     enum ZFS_IOC_SEND_SPACE = zfs_ioc.ZFS_IOC_SEND_SPACE;
577     enum ZFS_IOC_CLONE = zfs_ioc.ZFS_IOC_CLONE;
578     enum ZFS_IOC_BOOKMARK = zfs_ioc.ZFS_IOC_BOOKMARK;
579     enum ZFS_IOC_GET_BOOKMARKS = zfs_ioc.ZFS_IOC_GET_BOOKMARKS;
580     enum ZFS_IOC_DESTROY_BOOKMARKS = zfs_ioc.ZFS_IOC_DESTROY_BOOKMARKS;
581     enum ZFS_IOC_RECV_NEW = zfs_ioc.ZFS_IOC_RECV_NEW;
582     enum ZFS_IOC_POOL_SYNC = zfs_ioc.ZFS_IOC_POOL_SYNC;
583     enum ZFS_IOC_CHANNEL_PROGRAM = zfs_ioc.ZFS_IOC_CHANNEL_PROGRAM;
584     enum ZFS_IOC_LOAD_KEY = zfs_ioc.ZFS_IOC_LOAD_KEY;
585     enum ZFS_IOC_UNLOAD_KEY = zfs_ioc.ZFS_IOC_UNLOAD_KEY;
586     enum ZFS_IOC_CHANGE_KEY = zfs_ioc.ZFS_IOC_CHANGE_KEY;
587     enum ZFS_IOC_REMAP = zfs_ioc.ZFS_IOC_REMAP;
588     enum ZFS_IOC_POOL_CHECKPOINT = zfs_ioc.ZFS_IOC_POOL_CHECKPOINT;
589     enum ZFS_IOC_POOL_DISCARD_CHECKPOINT = zfs_ioc.ZFS_IOC_POOL_DISCARD_CHECKPOINT;
590     enum ZFS_IOC_POOL_INITIALIZE = zfs_ioc.ZFS_IOC_POOL_INITIALIZE;
591     enum ZFS_IOC_POOL_TRIM = zfs_ioc.ZFS_IOC_POOL_TRIM;
592     enum ZFS_IOC_LINUX = zfs_ioc.ZFS_IOC_LINUX;
593     enum ZFS_IOC_EVENTS_NEXT = zfs_ioc.ZFS_IOC_EVENTS_NEXT;
594     enum ZFS_IOC_EVENTS_CLEAR = zfs_ioc.ZFS_IOC_EVENTS_CLEAR;
595     enum ZFS_IOC_EVENTS_SEEK = zfs_ioc.ZFS_IOC_EVENTS_SEEK;
596     enum ZFS_IOC_FREEBSD = zfs_ioc.ZFS_IOC_FREEBSD;
597     enum ZFS_IOC_LAST = zfs_ioc.ZFS_IOC_LAST;
598     alias zfs_ioc_t = zfs_ioc;
599     enum _Anonymous_3
600     {
601         VDEV_TRIM_NONE = 0,
602         VDEV_TRIM_ACTIVE = 1,
603         VDEV_TRIM_CANCELED = 2,
604         VDEV_TRIM_SUSPENDED = 3,
605         VDEV_TRIM_COMPLETE = 4,
606     }
607     enum VDEV_TRIM_NONE = _Anonymous_3.VDEV_TRIM_NONE;
608     enum VDEV_TRIM_ACTIVE = _Anonymous_3.VDEV_TRIM_ACTIVE;
609     enum VDEV_TRIM_CANCELED = _Anonymous_3.VDEV_TRIM_CANCELED;
610     enum VDEV_TRIM_SUSPENDED = _Anonymous_3.VDEV_TRIM_SUSPENDED;
611     enum VDEV_TRIM_COMPLETE = _Anonymous_3.VDEV_TRIM_COMPLETE;
612     alias vdev_trim_state_t = _Anonymous_3;
613     enum _Anonymous_4
614     {
615         VDEV_INITIALIZE_NONE = 0,
616         VDEV_INITIALIZE_ACTIVE = 1,
617         VDEV_INITIALIZE_CANCELED = 2,
618         VDEV_INITIALIZE_SUSPENDED = 3,
619         VDEV_INITIALIZE_COMPLETE = 4,
620     }
621     enum VDEV_INITIALIZE_NONE = _Anonymous_4.VDEV_INITIALIZE_NONE;
622     enum VDEV_INITIALIZE_ACTIVE = _Anonymous_4.VDEV_INITIALIZE_ACTIVE;
623     enum VDEV_INITIALIZE_CANCELED = _Anonymous_4.VDEV_INITIALIZE_CANCELED;
624     enum VDEV_INITIALIZE_SUSPENDED = _Anonymous_4.VDEV_INITIALIZE_SUSPENDED;
625     enum VDEV_INITIALIZE_COMPLETE = _Anonymous_4.VDEV_INITIALIZE_COMPLETE;
626     alias vdev_initializing_state_t = _Anonymous_4;
627     struct ddt_histogram
628     {
629         @DppOffsetSize(0,4096) ddt_stat[64] ddh_stat;
630     }
631     alias ddt_histogram_t = ddt_histogram;
632     struct ddt_stat
633     {
634         @DppOffsetSize(0,8) ulong dds_blocks;
635         @DppOffsetSize(8,8) ulong dds_lsize;
636         @DppOffsetSize(16,8) ulong dds_psize;
637         @DppOffsetSize(24,8) ulong dds_dsize;
638         @DppOffsetSize(32,8) ulong dds_ref_blocks;
639         @DppOffsetSize(40,8) ulong dds_ref_lsize;
640         @DppOffsetSize(48,8) ulong dds_ref_psize;
641         @DppOffsetSize(56,8) ulong dds_ref_dsize;
642     }
643     alias ddt_stat_t = ddt_stat;
644     struct ddt_object
645     {
646         @DppOffsetSize(0,8) ulong ddo_count;
647         @DppOffsetSize(8,8) ulong ddo_dspace;
648         @DppOffsetSize(16,8) ulong ddo_mspace;
649     }
650     alias ddt_object_t = ddt_object;
651     enum pool_trim_func
652     {
653         POOL_TRIM_START = 0,
654         POOL_TRIM_CANCEL = 1,
655         POOL_TRIM_SUSPEND = 2,
656         POOL_TRIM_FUNCS = 3,
657     }
658     enum POOL_TRIM_START = pool_trim_func.POOL_TRIM_START;
659     enum POOL_TRIM_CANCEL = pool_trim_func.POOL_TRIM_CANCEL;
660     enum POOL_TRIM_SUSPEND = pool_trim_func.POOL_TRIM_SUSPEND;
661     enum POOL_TRIM_FUNCS = pool_trim_func.POOL_TRIM_FUNCS;
662     alias pool_trim_func_t = pool_trim_func;
663     enum pool_initialize_func
664     {
665         POOL_INITIALIZE_START = 0,
666         POOL_INITIALIZE_CANCEL = 1,
667         POOL_INITIALIZE_SUSPEND = 2,
668         POOL_INITIALIZE_FUNCS = 3,
669     }
670     enum POOL_INITIALIZE_START = pool_initialize_func.POOL_INITIALIZE_START;
671     enum POOL_INITIALIZE_CANCEL = pool_initialize_func.POOL_INITIALIZE_CANCEL;
672     enum POOL_INITIALIZE_SUSPEND = pool_initialize_func.POOL_INITIALIZE_SUSPEND;
673     enum POOL_INITIALIZE_FUNCS = pool_initialize_func.POOL_INITIALIZE_FUNCS;
674     alias pool_initialize_func_t = pool_initialize_func;
675     struct vdev_stat_ex
676     {
677         @DppOffsetSize(0,64) ulong[8] vsx_active_queue;
678         @DppOffsetSize(64,64) ulong[8] vsx_pend_queue;
679         @DppOffsetSize(128,2368) ulong[37][8] vsx_queue_histo;
680         @DppOffsetSize(2496,2072) ulong[37][7] vsx_total_histo;
681         @DppOffsetSize(4568,2072) ulong[37][7] vsx_disk_histo;
682         @DppOffsetSize(6640,1600) ulong[25][8] vsx_ind_histo;
683         @DppOffsetSize(8240,1600) ulong[25][8] vsx_agg_histo;
684     }
685     alias vdev_stat_ex_t = vdev_stat_ex;
686     struct vdev_stat
687     {
688         @DppOffsetSize(0,8) ulong vs_timestamp;
689         @DppOffsetSize(8,8) ulong vs_state;
690         @DppOffsetSize(16,8) ulong vs_aux;
691         @DppOffsetSize(24,8) ulong vs_alloc;
692         @DppOffsetSize(32,8) ulong vs_space;
693         @DppOffsetSize(40,8) ulong vs_dspace;
694         @DppOffsetSize(48,8) ulong vs_rsize;
695         @DppOffsetSize(56,8) ulong vs_esize;
696         @DppOffsetSize(64,48) ulong[6] vs_ops;
697         @DppOffsetSize(112,48) ulong[6] vs_bytes;
698         @DppOffsetSize(160,8) ulong vs_read_errors;
699         @DppOffsetSize(168,8) ulong vs_write_errors;
700         @DppOffsetSize(176,8) ulong vs_checksum_errors;
701         @DppOffsetSize(184,8) ulong vs_initialize_errors;
702         @DppOffsetSize(192,8) ulong vs_self_healed;
703         @DppOffsetSize(200,8) ulong vs_scan_removing;
704         @DppOffsetSize(208,8) ulong vs_scan_processed;
705         @DppOffsetSize(216,8) ulong vs_fragmentation;
706         @DppOffsetSize(224,8) ulong vs_initialize_bytes_done;
707         @DppOffsetSize(232,8) ulong vs_initialize_bytes_est;
708         @DppOffsetSize(240,8) ulong vs_initialize_state;
709         @DppOffsetSize(248,8) ulong vs_initialize_action_time;
710         @DppOffsetSize(256,8) ulong vs_checkpoint_space;
711         @DppOffsetSize(264,8) ulong vs_resilver_deferred;
712         @DppOffsetSize(272,8) ulong vs_slow_ios;
713         @DppOffsetSize(280,8) ulong vs_trim_errors;
714         @DppOffsetSize(288,8) ulong vs_trim_notsup;
715         @DppOffsetSize(296,8) ulong vs_trim_bytes_done;
716         @DppOffsetSize(304,8) ulong vs_trim_bytes_est;
717         @DppOffsetSize(312,8) ulong vs_trim_state;
718         @DppOffsetSize(320,8) ulong vs_trim_action_time;
719     }
720     alias vdev_stat_t = vdev_stat;
721     enum zpool_errata
722     {
723         ZPOOL_ERRATA_NONE = 0,
724         ZPOOL_ERRATA_ZOL_2094_SCRUB = 1,
725         ZPOOL_ERRATA_ZOL_2094_ASYNC_DESTROY = 2,
726         ZPOOL_ERRATA_ZOL_6845_ENCRYPTION = 3,
727         ZPOOL_ERRATA_ZOL_8308_ENCRYPTION = 4,
728     }
729     enum ZPOOL_ERRATA_NONE = zpool_errata.ZPOOL_ERRATA_NONE;
730     enum ZPOOL_ERRATA_ZOL_2094_SCRUB = zpool_errata.ZPOOL_ERRATA_ZOL_2094_SCRUB;
731     enum ZPOOL_ERRATA_ZOL_2094_ASYNC_DESTROY = zpool_errata.ZPOOL_ERRATA_ZOL_2094_ASYNC_DESTROY;
732     enum ZPOOL_ERRATA_ZOL_6845_ENCRYPTION = zpool_errata.ZPOOL_ERRATA_ZOL_6845_ENCRYPTION;
733     enum ZPOOL_ERRATA_ZOL_8308_ENCRYPTION = zpool_errata.ZPOOL_ERRATA_ZOL_8308_ENCRYPTION;
734     alias zpool_errata_t = zpool_errata;
735     enum dsl_scan_state
736     {
737         DSS_NONE = 0,
738         DSS_SCANNING = 1,
739         DSS_FINISHED = 2,
740         DSS_CANCELED = 3,
741         DSS_NUM_STATES = 4,
742     }
743     enum DSS_NONE = dsl_scan_state.DSS_NONE;
744     enum DSS_SCANNING = dsl_scan_state.DSS_SCANNING;
745     enum DSS_FINISHED = dsl_scan_state.DSS_FINISHED;
746     enum DSS_CANCELED = dsl_scan_state.DSS_CANCELED;
747     enum DSS_NUM_STATES = dsl_scan_state.DSS_NUM_STATES;
748     alias dsl_scan_state_t = dsl_scan_state;
749     struct pool_removal_stat
750     {
751         @DppOffsetSize(0,8) ulong prs_state;
752         @DppOffsetSize(8,8) ulong prs_removing_vdev;
753         @DppOffsetSize(16,8) ulong prs_start_time;
754         @DppOffsetSize(24,8) ulong prs_end_time;
755         @DppOffsetSize(32,8) ulong prs_to_copy;
756         @DppOffsetSize(40,8) ulong prs_copied;
757         @DppOffsetSize(48,8) ulong prs_mapping_memory;
758     }
759     alias pool_removal_stat_t = pool_removal_stat;
760     struct pool_scan_stat
761     {
762         @DppOffsetSize(0,8) ulong pss_func;
763         @DppOffsetSize(8,8) ulong pss_state;
764         @DppOffsetSize(16,8) ulong pss_start_time;
765         @DppOffsetSize(24,8) ulong pss_end_time;
766         @DppOffsetSize(32,8) ulong pss_to_examine;
767         @DppOffsetSize(40,8) ulong pss_examined;
768         @DppOffsetSize(48,8) ulong pss_to_process;
769         @DppOffsetSize(56,8) ulong pss_processed;
770         @DppOffsetSize(64,8) ulong pss_errors;
771         @DppOffsetSize(72,8) ulong pss_pass_exam;
772         @DppOffsetSize(80,8) ulong pss_pass_start;
773         @DppOffsetSize(88,8) ulong pss_pass_scrub_pause;
774         @DppOffsetSize(96,8) ulong pss_pass_scrub_spent_paused;
775         @DppOffsetSize(104,8) ulong pss_pass_issued;
776         @DppOffsetSize(112,8) ulong pss_issued;
777     }
778     alias pool_scan_stat_t = pool_scan_stat;
779     enum zio_type
780     {
781         ZIO_TYPE_NULL = 0,
782         ZIO_TYPE_READ = 1,
783         ZIO_TYPE_WRITE = 2,
784         ZIO_TYPE_FREE = 3,
785         ZIO_TYPE_CLAIM = 4,
786         ZIO_TYPE_IOCTL = 5,
787         ZIO_TYPE_TRIM = 6,
788         ZIO_TYPES = 7,
789     }
790     enum ZIO_TYPE_NULL = zio_type.ZIO_TYPE_NULL;
791     enum ZIO_TYPE_READ = zio_type.ZIO_TYPE_READ;
792     enum ZIO_TYPE_WRITE = zio_type.ZIO_TYPE_WRITE;
793     enum ZIO_TYPE_FREE = zio_type.ZIO_TYPE_FREE;
794     enum ZIO_TYPE_CLAIM = zio_type.ZIO_TYPE_CLAIM;
795     enum ZIO_TYPE_IOCTL = zio_type.ZIO_TYPE_IOCTL;
796     enum ZIO_TYPE_TRIM = zio_type.ZIO_TYPE_TRIM;
797     enum ZIO_TYPES = zio_type.ZIO_TYPES;
798     alias zio_type_t = zio_type;
799     struct pool_checkpoint_stat
800     {
801         @DppOffsetSize(0,8) ulong pcs_state;
802         @DppOffsetSize(8,8) ulong pcs_start_time;
803         @DppOffsetSize(16,8) ulong pcs_space;
804     }
805     alias pool_checkpoint_stat_t = pool_checkpoint_stat;
806     enum _Anonymous_5
807     {
808         CS_NONE = 0,
809         CS_CHECKPOINT_EXISTS = 1,
810         CS_CHECKPOINT_DISCARDING = 2,
811         CS_NUM_STATES = 3,
812     }
813     enum CS_NONE = _Anonymous_5.CS_NONE;
814     enum CS_CHECKPOINT_EXISTS = _Anonymous_5.CS_CHECKPOINT_EXISTS;
815     enum CS_CHECKPOINT_DISCARDING = _Anonymous_5.CS_CHECKPOINT_DISCARDING;
816     enum CS_NUM_STATES = _Anonymous_5.CS_NUM_STATES;
817     alias checkpoint_state_t = _Anonymous_5;
818     enum pool_scrub_cmd
819     {
820         POOL_SCRUB_NORMAL = 0,
821         POOL_SCRUB_PAUSE = 1,
822         POOL_SCRUB_FLAGS_END = 2,
823     }
824     enum POOL_SCRUB_NORMAL = pool_scrub_cmd.POOL_SCRUB_NORMAL;
825     enum POOL_SCRUB_PAUSE = pool_scrub_cmd.POOL_SCRUB_PAUSE;
826     enum POOL_SCRUB_FLAGS_END = pool_scrub_cmd.POOL_SCRUB_FLAGS_END;
827     alias pool_scrub_cmd_t = pool_scrub_cmd;
828     enum pool_scan_func
829     {
830         POOL_SCAN_NONE = 0,
831         POOL_SCAN_SCRUB = 1,
832         POOL_SCAN_RESILVER = 2,
833         POOL_SCAN_FUNCS = 3,
834     }
835     enum POOL_SCAN_NONE = pool_scan_func.POOL_SCAN_NONE;
836     enum POOL_SCAN_SCRUB = pool_scan_func.POOL_SCAN_SCRUB;
837     enum POOL_SCAN_RESILVER = pool_scan_func.POOL_SCAN_RESILVER;
838     enum POOL_SCAN_FUNCS = pool_scan_func.POOL_SCAN_FUNCS;
839     alias pool_scan_func_t = pool_scan_func;
840     enum mmp_state
841     {
842         MMP_STATE_ACTIVE = 0,
843         MMP_STATE_INACTIVE = 1,
844         MMP_STATE_NO_HOSTID = 2,
845     }
846     enum MMP_STATE_ACTIVE = mmp_state.MMP_STATE_ACTIVE;
847     enum MMP_STATE_INACTIVE = mmp_state.MMP_STATE_INACTIVE;
848     enum MMP_STATE_NO_HOSTID = mmp_state.MMP_STATE_NO_HOSTID;
849     alias mmp_state_t = mmp_state;
850     enum pool_state
851     {
852         POOL_STATE_ACTIVE = 0,
853         POOL_STATE_EXPORTED = 1,
854         POOL_STATE_DESTROYED = 2,
855         POOL_STATE_SPARE = 3,
856         POOL_STATE_L2CACHE = 4,
857         POOL_STATE_UNINITIALIZED = 5,
858         POOL_STATE_UNAVAIL = 6,
859         POOL_STATE_POTENTIALLY_ACTIVE = 7,
860     }
861     enum POOL_STATE_ACTIVE = pool_state.POOL_STATE_ACTIVE;
862     enum POOL_STATE_EXPORTED = pool_state.POOL_STATE_EXPORTED;
863     enum POOL_STATE_DESTROYED = pool_state.POOL_STATE_DESTROYED;
864     enum POOL_STATE_SPARE = pool_state.POOL_STATE_SPARE;
865     enum POOL_STATE_L2CACHE = pool_state.POOL_STATE_L2CACHE;
866     enum POOL_STATE_UNINITIALIZED = pool_state.POOL_STATE_UNINITIALIZED;
867     enum POOL_STATE_UNAVAIL = pool_state.POOL_STATE_UNAVAIL;
868     enum POOL_STATE_POTENTIALLY_ACTIVE = pool_state.POOL_STATE_POTENTIALLY_ACTIVE;
869     alias pool_state_t = pool_state;
870     enum vdev_aux
871     {
872         VDEV_AUX_NONE = 0,
873         VDEV_AUX_OPEN_FAILED = 1,
874         VDEV_AUX_CORRUPT_DATA = 2,
875         VDEV_AUX_NO_REPLICAS = 3,
876         VDEV_AUX_BAD_GUID_SUM = 4,
877         VDEV_AUX_TOO_SMALL = 5,
878         VDEV_AUX_BAD_LABEL = 6,
879         VDEV_AUX_VERSION_NEWER = 7,
880         VDEV_AUX_VERSION_OLDER = 8,
881         VDEV_AUX_UNSUP_FEAT = 9,
882         VDEV_AUX_SPARED = 10,
883         VDEV_AUX_ERR_EXCEEDED = 11,
884         VDEV_AUX_IO_FAILURE = 12,
885         VDEV_AUX_BAD_LOG = 13,
886         VDEV_AUX_EXTERNAL = 14,
887         VDEV_AUX_SPLIT_POOL = 15,
888         VDEV_AUX_BAD_ASHIFT = 16,
889         VDEV_AUX_EXTERNAL_PERSIST = 17,
890         VDEV_AUX_ACTIVE = 18,
891         VDEV_AUX_CHILDREN_OFFLINE = 19,
892     }
893     enum VDEV_AUX_NONE = vdev_aux.VDEV_AUX_NONE;
894     enum VDEV_AUX_OPEN_FAILED = vdev_aux.VDEV_AUX_OPEN_FAILED;
895     enum VDEV_AUX_CORRUPT_DATA = vdev_aux.VDEV_AUX_CORRUPT_DATA;
896     enum VDEV_AUX_NO_REPLICAS = vdev_aux.VDEV_AUX_NO_REPLICAS;
897     enum VDEV_AUX_BAD_GUID_SUM = vdev_aux.VDEV_AUX_BAD_GUID_SUM;
898     enum VDEV_AUX_TOO_SMALL = vdev_aux.VDEV_AUX_TOO_SMALL;
899     enum VDEV_AUX_BAD_LABEL = vdev_aux.VDEV_AUX_BAD_LABEL;
900     enum VDEV_AUX_VERSION_NEWER = vdev_aux.VDEV_AUX_VERSION_NEWER;
901     enum VDEV_AUX_VERSION_OLDER = vdev_aux.VDEV_AUX_VERSION_OLDER;
902     enum VDEV_AUX_UNSUP_FEAT = vdev_aux.VDEV_AUX_UNSUP_FEAT;
903     enum VDEV_AUX_SPARED = vdev_aux.VDEV_AUX_SPARED;
904     enum VDEV_AUX_ERR_EXCEEDED = vdev_aux.VDEV_AUX_ERR_EXCEEDED;
905     enum VDEV_AUX_IO_FAILURE = vdev_aux.VDEV_AUX_IO_FAILURE;
906     enum VDEV_AUX_BAD_LOG = vdev_aux.VDEV_AUX_BAD_LOG;
907     enum VDEV_AUX_EXTERNAL = vdev_aux.VDEV_AUX_EXTERNAL;
908     enum VDEV_AUX_SPLIT_POOL = vdev_aux.VDEV_AUX_SPLIT_POOL;
909     enum VDEV_AUX_BAD_ASHIFT = vdev_aux.VDEV_AUX_BAD_ASHIFT;
910     enum VDEV_AUX_EXTERNAL_PERSIST = vdev_aux.VDEV_AUX_EXTERNAL_PERSIST;
911     enum VDEV_AUX_ACTIVE = vdev_aux.VDEV_AUX_ACTIVE;
912     enum VDEV_AUX_CHILDREN_OFFLINE = vdev_aux.VDEV_AUX_CHILDREN_OFFLINE;
913     alias vdev_aux_t = vdev_aux;
914     enum vdev_state
915     {
916         VDEV_STATE_UNKNOWN = 0,
917         VDEV_STATE_CLOSED = 1,
918         VDEV_STATE_OFFLINE = 2,
919         VDEV_STATE_REMOVED = 3,
920         VDEV_STATE_CANT_OPEN = 4,
921         VDEV_STATE_FAULTED = 5,
922         VDEV_STATE_DEGRADED = 6,
923         VDEV_STATE_HEALTHY = 7,
924     }
925     enum VDEV_STATE_UNKNOWN = vdev_state.VDEV_STATE_UNKNOWN;
926     enum VDEV_STATE_CLOSED = vdev_state.VDEV_STATE_CLOSED;
927     enum VDEV_STATE_OFFLINE = vdev_state.VDEV_STATE_OFFLINE;
928     enum VDEV_STATE_REMOVED = vdev_state.VDEV_STATE_REMOVED;
929     enum VDEV_STATE_CANT_OPEN = vdev_state.VDEV_STATE_CANT_OPEN;
930     enum VDEV_STATE_FAULTED = vdev_state.VDEV_STATE_FAULTED;
931     enum VDEV_STATE_DEGRADED = vdev_state.VDEV_STATE_DEGRADED;
932     enum VDEV_STATE_HEALTHY = vdev_state.VDEV_STATE_HEALTHY;
933     alias vdev_state_t = vdev_state;
934     struct zpool_load_policy
935     {
936         @DppOffsetSize(0,4) uint zlp_rewind;
937         @DppOffsetSize(8,8) ulong zlp_maxmeta;
938         @DppOffsetSize(16,8) ulong zlp_maxdata;
939         @DppOffsetSize(24,8) ulong zlp_txg;
940     }
941     alias zpool_load_policy_t = zpool_load_policy;
942     enum zfs_key_location
943     {
944         ZFS_KEYLOCATION_NONE = 0,
945         ZFS_KEYLOCATION_PROMPT = 1,
946         ZFS_KEYLOCATION_URI = 2,
947         ZFS_KEYLOCATION_LOCATIONS = 3,
948     }
949     enum ZFS_KEYLOCATION_NONE = zfs_key_location.ZFS_KEYLOCATION_NONE;
950     enum ZFS_KEYLOCATION_PROMPT = zfs_key_location.ZFS_KEYLOCATION_PROMPT;
951     enum ZFS_KEYLOCATION_URI = zfs_key_location.ZFS_KEYLOCATION_URI;
952     enum ZFS_KEYLOCATION_LOCATIONS = zfs_key_location.ZFS_KEYLOCATION_LOCATIONS;
953     alias zfs_keylocation_t = zfs_key_location;
954     enum zfs_keyformat
955     {
956         ZFS_KEYFORMAT_NONE = 0,
957         ZFS_KEYFORMAT_RAW = 1,
958         ZFS_KEYFORMAT_HEX = 2,
959         ZFS_KEYFORMAT_PASSPHRASE = 3,
960         ZFS_KEYFORMAT_FORMATS = 4,
961     }
962     enum ZFS_KEYFORMAT_NONE = zfs_keyformat.ZFS_KEYFORMAT_NONE;
963     enum ZFS_KEYFORMAT_RAW = zfs_keyformat.ZFS_KEYFORMAT_RAW;
964     enum ZFS_KEYFORMAT_HEX = zfs_keyformat.ZFS_KEYFORMAT_HEX;
965     enum ZFS_KEYFORMAT_PASSPHRASE = zfs_keyformat.ZFS_KEYFORMAT_PASSPHRASE;
966     enum ZFS_KEYFORMAT_FORMATS = zfs_keyformat.ZFS_KEYFORMAT_FORMATS;
967     alias zfs_keyformat_t = zfs_keyformat;
968     enum zfs_keystatus
969     {
970         ZFS_KEYSTATUS_NONE = 0,
971         ZFS_KEYSTATUS_UNAVAILABLE = 1,
972         ZFS_KEYSTATUS_AVAILABLE = 2,
973     }
974     enum ZFS_KEYSTATUS_NONE = zfs_keystatus.ZFS_KEYSTATUS_NONE;
975     enum ZFS_KEYSTATUS_UNAVAILABLE = zfs_keystatus.ZFS_KEYSTATUS_UNAVAILABLE;
976     enum ZFS_KEYSTATUS_AVAILABLE = zfs_keystatus.ZFS_KEYSTATUS_AVAILABLE;
977     alias zfs_keystatus_t = zfs_keystatus;
978     enum _Anonymous_6
979     {
980         ZFS_VOLMODE_DEFAULT = 0,
981         ZFS_VOLMODE_GEOM = 1,
982         ZFS_VOLMODE_DEV = 2,
983         ZFS_VOLMODE_NONE = 3,
984     }
985     enum ZFS_VOLMODE_DEFAULT = _Anonymous_6.ZFS_VOLMODE_DEFAULT;
986     enum ZFS_VOLMODE_GEOM = _Anonymous_6.ZFS_VOLMODE_GEOM;
987     enum ZFS_VOLMODE_DEV = _Anonymous_6.ZFS_VOLMODE_DEV;
988     enum ZFS_VOLMODE_NONE = _Anonymous_6.ZFS_VOLMODE_NONE;
989     alias zfs_volmode_t = _Anonymous_6;
990     enum _Anonymous_7
991     {
992         ZFS_REDUNDANT_METADATA_ALL = 0,
993         ZFS_REDUNDANT_METADATA_MOST = 1,
994     }
995     enum ZFS_REDUNDANT_METADATA_ALL = _Anonymous_7.ZFS_REDUNDANT_METADATA_ALL;
996     enum ZFS_REDUNDANT_METADATA_MOST = _Anonymous_7.ZFS_REDUNDANT_METADATA_MOST;
997     alias zfs_redundant_metadata_type_t = _Anonymous_7;
998     enum _Anonymous_8
999     {
1000         ZFS_DNSIZE_LEGACY = 0,
1001         ZFS_DNSIZE_AUTO = 1,
1002         ZFS_DNSIZE_1K = 1024,
1003         ZFS_DNSIZE_2K = 2048,
1004         ZFS_DNSIZE_4K = 4096,
1005         ZFS_DNSIZE_8K = 8192,
1006         ZFS_DNSIZE_16K = 16384,
1007     }
1008     enum ZFS_DNSIZE_LEGACY = _Anonymous_8.ZFS_DNSIZE_LEGACY;
1009     enum ZFS_DNSIZE_AUTO = _Anonymous_8.ZFS_DNSIZE_AUTO;
1010     enum ZFS_DNSIZE_1K = _Anonymous_8.ZFS_DNSIZE_1K;
1011     enum ZFS_DNSIZE_2K = _Anonymous_8.ZFS_DNSIZE_2K;
1012     enum ZFS_DNSIZE_4K = _Anonymous_8.ZFS_DNSIZE_4K;
1013     enum ZFS_DNSIZE_8K = _Anonymous_8.ZFS_DNSIZE_8K;
1014     enum ZFS_DNSIZE_16K = _Anonymous_8.ZFS_DNSIZE_16K;
1015     alias zfs_dnsize_type_t = _Anonymous_8;
1016     enum _Anonymous_9
1017     {
1018         ZFS_XATTR_OFF = 0,
1019         ZFS_XATTR_DIR = 1,
1020         ZFS_XATTR_SA = 2,
1021     }
1022     enum ZFS_XATTR_OFF = _Anonymous_9.ZFS_XATTR_OFF;
1023     enum ZFS_XATTR_DIR = _Anonymous_9.ZFS_XATTR_DIR;
1024     enum ZFS_XATTR_SA = _Anonymous_9.ZFS_XATTR_SA;
1025     alias zfs_xattr_type_t = _Anonymous_9;
1026     enum _Anonymous_10
1027     {
1028         ZFS_SYNC_STANDARD = 0,
1029         ZFS_SYNC_ALWAYS = 1,
1030         ZFS_SYNC_DISABLED = 2,
1031     }
1032     enum ZFS_SYNC_STANDARD = _Anonymous_10.ZFS_SYNC_STANDARD;
1033     enum ZFS_SYNC_ALWAYS = _Anonymous_10.ZFS_SYNC_ALWAYS;
1034     enum ZFS_SYNC_DISABLED = _Anonymous_10.ZFS_SYNC_DISABLED;
1035     alias zfs_sync_type_t = _Anonymous_10;
1036     enum zfs_cache_type
1037     {
1038         ZFS_CACHE_NONE = 0,
1039         ZFS_CACHE_METADATA = 1,
1040         ZFS_CACHE_ALL = 2,
1041     }
1042     enum ZFS_CACHE_NONE = zfs_cache_type.ZFS_CACHE_NONE;
1043     enum ZFS_CACHE_METADATA = zfs_cache_type.ZFS_CACHE_METADATA;
1044     enum ZFS_CACHE_ALL = zfs_cache_type.ZFS_CACHE_ALL;
1045     alias zfs_cache_type_t = zfs_cache_type;
1046     enum zfs_smb_acl_op
1047     {
1048         ZFS_SMB_ACL_ADD = 0,
1049         ZFS_SMB_ACL_REMOVE = 1,
1050         ZFS_SMB_ACL_RENAME = 2,
1051         ZFS_SMB_ACL_PURGE = 3,
1052     }
1053     enum ZFS_SMB_ACL_ADD = zfs_smb_acl_op.ZFS_SMB_ACL_ADD;
1054     enum ZFS_SMB_ACL_REMOVE = zfs_smb_acl_op.ZFS_SMB_ACL_REMOVE;
1055     enum ZFS_SMB_ACL_RENAME = zfs_smb_acl_op.ZFS_SMB_ACL_RENAME;
1056     enum ZFS_SMB_ACL_PURGE = zfs_smb_acl_op.ZFS_SMB_ACL_PURGE;
1057     alias zfs_smb_acl_op_t = zfs_smb_acl_op;
1058     enum zfs_share_op
1059     {
1060         ZFS_SHARE_NFS = 0,
1061         ZFS_UNSHARE_NFS = 1,
1062         ZFS_SHARE_SMB = 2,
1063         ZFS_UNSHARE_SMB = 3,
1064     }
1065     enum ZFS_SHARE_NFS = zfs_share_op.ZFS_SHARE_NFS;
1066     enum ZFS_UNSHARE_NFS = zfs_share_op.ZFS_UNSHARE_NFS;
1067     enum ZFS_SHARE_SMB = zfs_share_op.ZFS_SHARE_SMB;
1068     enum ZFS_UNSHARE_SMB = zfs_share_op.ZFS_UNSHARE_SMB;
1069     alias zfs_share_op_t = zfs_share_op;
1070     enum _Anonymous_11
1071     {
1072         ZFS_LOGBIAS_LATENCY = 0,
1073         ZFS_LOGBIAS_THROUGHPUT = 1,
1074     }
1075     enum ZFS_LOGBIAS_LATENCY = _Anonymous_11.ZFS_LOGBIAS_LATENCY;
1076     enum ZFS_LOGBIAS_THROUGHPUT = _Anonymous_11.ZFS_LOGBIAS_THROUGHPUT;
1077     alias zfs_logbias_op_t = _Anonymous_11;
1078     enum _Anonymous_12
1079     {
1080         ZFS_CANMOUNT_OFF = 0,
1081         ZFS_CANMOUNT_ON = 1,
1082         ZFS_CANMOUNT_NOAUTO = 2,
1083     }
1084     enum ZFS_CANMOUNT_OFF = _Anonymous_12.ZFS_CANMOUNT_OFF;
1085     enum ZFS_CANMOUNT_ON = _Anonymous_12.ZFS_CANMOUNT_ON;
1086     enum ZFS_CANMOUNT_NOAUTO = _Anonymous_12.ZFS_CANMOUNT_NOAUTO;
1087     alias zfs_canmount_type_t = _Anonymous_12;
1088     enum _Anonymous_13
1089     {
1090         ZFS_DELEG_NONE = 0,
1091         ZFS_DELEG_PERM_LOCAL = 1,
1092         ZFS_DELEG_PERM_DESCENDENT = 2,
1093         ZFS_DELEG_PERM_LOCALDESCENDENT = 3,
1094         ZFS_DELEG_PERM_CREATE = 4,
1095     }
1096     enum ZFS_DELEG_NONE = _Anonymous_13.ZFS_DELEG_NONE;
1097     enum ZFS_DELEG_PERM_LOCAL = _Anonymous_13.ZFS_DELEG_PERM_LOCAL;
1098     enum ZFS_DELEG_PERM_DESCENDENT = _Anonymous_13.ZFS_DELEG_PERM_DESCENDENT;
1099     enum ZFS_DELEG_PERM_LOCALDESCENDENT = _Anonymous_13.ZFS_DELEG_PERM_LOCALDESCENDENT;
1100     enum ZFS_DELEG_PERM_CREATE = _Anonymous_13.ZFS_DELEG_PERM_CREATE;
1101     alias zfs_deleg_inherit_t = _Anonymous_13;
1102     enum _Anonymous_14
1103     {
1104         ZFS_DELEG_WHO_UNKNOWN = 0,
1105         ZFS_DELEG_USER = 117,
1106         ZFS_DELEG_USER_SETS = 85,
1107         ZFS_DELEG_GROUP = 103,
1108         ZFS_DELEG_GROUP_SETS = 71,
1109         ZFS_DELEG_EVERYONE = 101,
1110         ZFS_DELEG_EVERYONE_SETS = 69,
1111         ZFS_DELEG_CREATE = 99,
1112         ZFS_DELEG_CREATE_SETS = 67,
1113         ZFS_DELEG_NAMED_SET = 115,
1114         ZFS_DELEG_NAMED_SET_SETS = 83,
1115     }
1116     enum ZFS_DELEG_WHO_UNKNOWN = _Anonymous_14.ZFS_DELEG_WHO_UNKNOWN;
1117     enum ZFS_DELEG_USER = _Anonymous_14.ZFS_DELEG_USER;
1118     enum ZFS_DELEG_USER_SETS = _Anonymous_14.ZFS_DELEG_USER_SETS;
1119     enum ZFS_DELEG_GROUP = _Anonymous_14.ZFS_DELEG_GROUP;
1120     enum ZFS_DELEG_GROUP_SETS = _Anonymous_14.ZFS_DELEG_GROUP_SETS;
1121     enum ZFS_DELEG_EVERYONE = _Anonymous_14.ZFS_DELEG_EVERYONE;
1122     enum ZFS_DELEG_EVERYONE_SETS = _Anonymous_14.ZFS_DELEG_EVERYONE_SETS;
1123     enum ZFS_DELEG_CREATE = _Anonymous_14.ZFS_DELEG_CREATE;
1124     enum ZFS_DELEG_CREATE_SETS = _Anonymous_14.ZFS_DELEG_CREATE_SETS;
1125     enum ZFS_DELEG_NAMED_SET = _Anonymous_14.ZFS_DELEG_NAMED_SET;
1126     enum ZFS_DELEG_NAMED_SET_SETS = _Anonymous_14.ZFS_DELEG_NAMED_SET_SETS;
1127     alias zfs_deleg_who_type_t = _Anonymous_14;
1128     ulong zpool_prop_random_value(zpool_prop_t, ulong) @nogc nothrow;
1129     int zpool_prop_string_to_index(zpool_prop_t, const(char)*, ulong*) @nogc nothrow;
1130     int zpool_prop_index_to_string(zpool_prop_t, ulong, const(char)**) @nogc nothrow;
1131     int zpool_prop_unsupported(const(char)*) @nogc nothrow;
1132     int zpool_prop_feature(const(char)*) @nogc nothrow;
1133     int zpool_prop_setonce(zpool_prop_t) @nogc nothrow;
1134     int zpool_prop_readonly(zpool_prop_t) @nogc nothrow;
1135     ulong zpool_prop_default_numeric(zpool_prop_t) @nogc nothrow;
1136     const(char)* zpool_prop_default_string(zpool_prop_t) @nogc nothrow;
1137     const(char)* zpool_prop_to_name(zpool_prop_t) @nogc nothrow;
1138     zpool_prop_t zpool_name_to_prop(const(char)*) @nogc nothrow;
1139     int zfs_prop_valid_for_type(int, zfs_type_t, int) @nogc nothrow;
1140     ulong zfs_prop_random_value(zfs_prop_t, ulong) @nogc nothrow;
1141     int zfs_prop_string_to_index(zfs_prop_t, const(char)*, ulong*) @nogc nothrow;
1142     int zfs_prop_index_to_string(zfs_prop_t, ulong, const(char)**) @nogc nothrow;
1143     int zfs_prop_written(const(char)*) @nogc nothrow;
1144     int zfs_prop_userquota(const(char)*) @nogc nothrow;
1145     int zfs_prop_user(const(char)*) @nogc nothrow;
1146     zfs_prop_t zfs_name_to_prop(const(char)*) @nogc nothrow;
1147     const(char)* zfs_prop_to_name(zfs_prop_t) @nogc nothrow;
1148     int zfs_prop_valid_keylocation(const(char)*, int) @nogc nothrow;
1149     int zfs_prop_encryption_key_param(zfs_prop_t) @nogc nothrow;
1150     int zfs_prop_setonce(zfs_prop_t) @nogc nothrow;
1151     int zfs_prop_inheritable(zfs_prop_t) @nogc nothrow;
1152     int zfs_prop_visible(zfs_prop_t) @nogc nothrow;
1153     int zfs_prop_readonly(zfs_prop_t) @nogc nothrow;
1154     ulong zfs_prop_default_numeric(zfs_prop_t) @nogc nothrow;
1155     const(char)* zfs_prop_default_string(zfs_prop_t) @nogc nothrow;
1156     alias zprop_func = int function(int, void*);
1157     enum _Anonymous_15
1158     {
1159         ZPROP_ERR_NOCLEAR = 1,
1160         ZPROP_ERR_NORESTORE = 2,
1161     }
1162     enum ZPROP_ERR_NOCLEAR = _Anonymous_15.ZPROP_ERR_NOCLEAR;
1163     enum ZPROP_ERR_NORESTORE = _Anonymous_15.ZPROP_ERR_NORESTORE;
1164     alias zprop_errflags_t = _Anonymous_15;
1165     enum _Anonymous_16
1166     {
1167         ZPROP_SRC_NONE = 1,
1168         ZPROP_SRC_DEFAULT = 2,
1169         ZPROP_SRC_TEMPORARY = 4,
1170         ZPROP_SRC_LOCAL = 8,
1171         ZPROP_SRC_INHERITED = 16,
1172         ZPROP_SRC_RECEIVED = 32,
1173     }
1174     enum ZPROP_SRC_NONE = _Anonymous_16.ZPROP_SRC_NONE;
1175     enum ZPROP_SRC_DEFAULT = _Anonymous_16.ZPROP_SRC_DEFAULT;
1176     enum ZPROP_SRC_TEMPORARY = _Anonymous_16.ZPROP_SRC_TEMPORARY;
1177     enum ZPROP_SRC_LOCAL = _Anonymous_16.ZPROP_SRC_LOCAL;
1178     enum ZPROP_SRC_INHERITED = _Anonymous_16.ZPROP_SRC_INHERITED;
1179     enum ZPROP_SRC_RECEIVED = _Anonymous_16.ZPROP_SRC_RECEIVED;
1180     alias zprop_source_t = _Anonymous_16;
1181     enum _Anonymous_17
1182     {
1183         ZPOOL_PROP_INVAL = -1,
1184         ZPOOL_PROP_NAME = 0,
1185         ZPOOL_PROP_SIZE = 1,
1186         ZPOOL_PROP_CAPACITY = 2,
1187         ZPOOL_PROP_ALTROOT = 3,
1188         ZPOOL_PROP_HEALTH = 4,
1189         ZPOOL_PROP_GUID = 5,
1190         ZPOOL_PROP_VERSION = 6,
1191         ZPOOL_PROP_BOOTFS = 7,
1192         ZPOOL_PROP_DELEGATION = 8,
1193         ZPOOL_PROP_AUTOREPLACE = 9,
1194         ZPOOL_PROP_CACHEFILE = 10,
1195         ZPOOL_PROP_FAILUREMODE = 11,
1196         ZPOOL_PROP_LISTSNAPS = 12,
1197         ZPOOL_PROP_AUTOEXPAND = 13,
1198         ZPOOL_PROP_DEDUPDITTO = 14,
1199         ZPOOL_PROP_DEDUPRATIO = 15,
1200         ZPOOL_PROP_FREE = 16,
1201         ZPOOL_PROP_ALLOCATED = 17,
1202         ZPOOL_PROP_READONLY = 18,
1203         ZPOOL_PROP_ASHIFT = 19,
1204         ZPOOL_PROP_COMMENT = 20,
1205         ZPOOL_PROP_EXPANDSZ = 21,
1206         ZPOOL_PROP_FREEING = 22,
1207         ZPOOL_PROP_FRAGMENTATION = 23,
1208         ZPOOL_PROP_LEAKED = 24,
1209         ZPOOL_PROP_MAXBLOCKSIZE = 25,
1210         ZPOOL_PROP_TNAME = 26,
1211         ZPOOL_PROP_MAXDNODESIZE = 27,
1212         ZPOOL_PROP_MULTIHOST = 28,
1213         ZPOOL_PROP_CHECKPOINT = 29,
1214         ZPOOL_PROP_LOAD_GUID = 30,
1215         ZPOOL_PROP_AUTOTRIM = 31,
1216         ZPOOL_NUM_PROPS = 32,
1217     }
1218     enum ZPOOL_PROP_INVAL = _Anonymous_17.ZPOOL_PROP_INVAL;
1219     enum ZPOOL_PROP_NAME = _Anonymous_17.ZPOOL_PROP_NAME;
1220     enum ZPOOL_PROP_SIZE = _Anonymous_17.ZPOOL_PROP_SIZE;
1221     enum ZPOOL_PROP_CAPACITY = _Anonymous_17.ZPOOL_PROP_CAPACITY;
1222     enum ZPOOL_PROP_ALTROOT = _Anonymous_17.ZPOOL_PROP_ALTROOT;
1223     enum ZPOOL_PROP_HEALTH = _Anonymous_17.ZPOOL_PROP_HEALTH;
1224     enum ZPOOL_PROP_GUID = _Anonymous_17.ZPOOL_PROP_GUID;
1225     enum ZPOOL_PROP_VERSION = _Anonymous_17.ZPOOL_PROP_VERSION;
1226     enum ZPOOL_PROP_BOOTFS = _Anonymous_17.ZPOOL_PROP_BOOTFS;
1227     enum ZPOOL_PROP_DELEGATION = _Anonymous_17.ZPOOL_PROP_DELEGATION;
1228     enum ZPOOL_PROP_AUTOREPLACE = _Anonymous_17.ZPOOL_PROP_AUTOREPLACE;
1229     enum ZPOOL_PROP_CACHEFILE = _Anonymous_17.ZPOOL_PROP_CACHEFILE;
1230     enum ZPOOL_PROP_FAILUREMODE = _Anonymous_17.ZPOOL_PROP_FAILUREMODE;
1231     enum ZPOOL_PROP_LISTSNAPS = _Anonymous_17.ZPOOL_PROP_LISTSNAPS;
1232     enum ZPOOL_PROP_AUTOEXPAND = _Anonymous_17.ZPOOL_PROP_AUTOEXPAND;
1233     enum ZPOOL_PROP_DEDUPDITTO = _Anonymous_17.ZPOOL_PROP_DEDUPDITTO;
1234     enum ZPOOL_PROP_DEDUPRATIO = _Anonymous_17.ZPOOL_PROP_DEDUPRATIO;
1235     enum ZPOOL_PROP_FREE = _Anonymous_17.ZPOOL_PROP_FREE;
1236     enum ZPOOL_PROP_ALLOCATED = _Anonymous_17.ZPOOL_PROP_ALLOCATED;
1237     enum ZPOOL_PROP_READONLY = _Anonymous_17.ZPOOL_PROP_READONLY;
1238     enum ZPOOL_PROP_ASHIFT = _Anonymous_17.ZPOOL_PROP_ASHIFT;
1239     enum ZPOOL_PROP_COMMENT = _Anonymous_17.ZPOOL_PROP_COMMENT;
1240     enum ZPOOL_PROP_EXPANDSZ = _Anonymous_17.ZPOOL_PROP_EXPANDSZ;
1241     enum ZPOOL_PROP_FREEING = _Anonymous_17.ZPOOL_PROP_FREEING;
1242     enum ZPOOL_PROP_FRAGMENTATION = _Anonymous_17.ZPOOL_PROP_FRAGMENTATION;
1243     enum ZPOOL_PROP_LEAKED = _Anonymous_17.ZPOOL_PROP_LEAKED;
1244     enum ZPOOL_PROP_MAXBLOCKSIZE = _Anonymous_17.ZPOOL_PROP_MAXBLOCKSIZE;
1245     enum ZPOOL_PROP_TNAME = _Anonymous_17.ZPOOL_PROP_TNAME;
1246     enum ZPOOL_PROP_MAXDNODESIZE = _Anonymous_17.ZPOOL_PROP_MAXDNODESIZE;
1247     enum ZPOOL_PROP_MULTIHOST = _Anonymous_17.ZPOOL_PROP_MULTIHOST;
1248     enum ZPOOL_PROP_CHECKPOINT = _Anonymous_17.ZPOOL_PROP_CHECKPOINT;
1249     enum ZPOOL_PROP_LOAD_GUID = _Anonymous_17.ZPOOL_PROP_LOAD_GUID;
1250     enum ZPOOL_PROP_AUTOTRIM = _Anonymous_17.ZPOOL_PROP_AUTOTRIM;
1251     enum ZPOOL_NUM_PROPS = _Anonymous_17.ZPOOL_NUM_PROPS;
1252     alias zpool_prop_t = _Anonymous_17;
1253     extern __gshared const(char)*[12] zfs_userquota_prop_prefixes;
1254     enum _Anonymous_18
1255     {
1256         ZFS_PROP_USERUSED = 0,
1257         ZFS_PROP_USERQUOTA = 1,
1258         ZFS_PROP_GROUPUSED = 2,
1259         ZFS_PROP_GROUPQUOTA = 3,
1260         ZFS_PROP_USEROBJUSED = 4,
1261         ZFS_PROP_USEROBJQUOTA = 5,
1262         ZFS_PROP_GROUPOBJUSED = 6,
1263         ZFS_PROP_GROUPOBJQUOTA = 7,
1264         ZFS_PROP_PROJECTUSED = 8,
1265         ZFS_PROP_PROJECTQUOTA = 9,
1266         ZFS_PROP_PROJECTOBJUSED = 10,
1267         ZFS_PROP_PROJECTOBJQUOTA = 11,
1268         ZFS_NUM_USERQUOTA_PROPS = 12,
1269     }
1270     enum ZFS_PROP_USERUSED = _Anonymous_18.ZFS_PROP_USERUSED;
1271     enum ZFS_PROP_USERQUOTA = _Anonymous_18.ZFS_PROP_USERQUOTA;
1272     enum ZFS_PROP_GROUPUSED = _Anonymous_18.ZFS_PROP_GROUPUSED;
1273     enum ZFS_PROP_GROUPQUOTA = _Anonymous_18.ZFS_PROP_GROUPQUOTA;
1274     enum ZFS_PROP_USEROBJUSED = _Anonymous_18.ZFS_PROP_USEROBJUSED;
1275     enum ZFS_PROP_USEROBJQUOTA = _Anonymous_18.ZFS_PROP_USEROBJQUOTA;
1276     enum ZFS_PROP_GROUPOBJUSED = _Anonymous_18.ZFS_PROP_GROUPOBJUSED;
1277     enum ZFS_PROP_GROUPOBJQUOTA = _Anonymous_18.ZFS_PROP_GROUPOBJQUOTA;
1278     enum ZFS_PROP_PROJECTUSED = _Anonymous_18.ZFS_PROP_PROJECTUSED;
1279     enum ZFS_PROP_PROJECTQUOTA = _Anonymous_18.ZFS_PROP_PROJECTQUOTA;
1280     enum ZFS_PROP_PROJECTOBJUSED = _Anonymous_18.ZFS_PROP_PROJECTOBJUSED;
1281     enum ZFS_PROP_PROJECTOBJQUOTA = _Anonymous_18.ZFS_PROP_PROJECTOBJQUOTA;
1282     enum ZFS_NUM_USERQUOTA_PROPS = _Anonymous_18.ZFS_NUM_USERQUOTA_PROPS;
1283     alias zfs_userquota_prop_t = _Anonymous_18;
1284     enum _Anonymous_19
1285     {
1286         ZPROP_CONT = -2,
1287         ZPROP_INVAL = -1,
1288         ZFS_PROP_TYPE = 0,
1289         ZFS_PROP_CREATION = 1,
1290         ZFS_PROP_USED = 2,
1291         ZFS_PROP_AVAILABLE = 3,
1292         ZFS_PROP_REFERENCED = 4,
1293         ZFS_PROP_COMPRESSRATIO = 5,
1294         ZFS_PROP_MOUNTED = 6,
1295         ZFS_PROP_ORIGIN = 7,
1296         ZFS_PROP_QUOTA = 8,
1297         ZFS_PROP_RESERVATION = 9,
1298         ZFS_PROP_VOLSIZE = 10,
1299         ZFS_PROP_VOLBLOCKSIZE = 11,
1300         ZFS_PROP_RECORDSIZE = 12,
1301         ZFS_PROP_MOUNTPOINT = 13,
1302         ZFS_PROP_SHARENFS = 14,
1303         ZFS_PROP_CHECKSUM = 15,
1304         ZFS_PROP_COMPRESSION = 16,
1305         ZFS_PROP_ATIME = 17,
1306         ZFS_PROP_DEVICES = 18,
1307         ZFS_PROP_EXEC = 19,
1308         ZFS_PROP_SETUID = 20,
1309         ZFS_PROP_READONLY = 21,
1310         ZFS_PROP_ZONED = 22,
1311         ZFS_PROP_SNAPDIR = 23,
1312         ZFS_PROP_PRIVATE = 24,
1313         ZFS_PROP_ACLINHERIT = 25,
1314         ZFS_PROP_CREATETXG = 26,
1315         ZFS_PROP_NAME = 27,
1316         ZFS_PROP_CANMOUNT = 28,
1317         ZFS_PROP_ISCSIOPTIONS = 29,
1318         ZFS_PROP_XATTR = 30,
1319         ZFS_PROP_NUMCLONES = 31,
1320         ZFS_PROP_COPIES = 32,
1321         ZFS_PROP_VERSION = 33,
1322         ZFS_PROP_UTF8ONLY = 34,
1323         ZFS_PROP_NORMALIZE = 35,
1324         ZFS_PROP_CASE = 36,
1325         ZFS_PROP_VSCAN = 37,
1326         ZFS_PROP_NBMAND = 38,
1327         ZFS_PROP_SHARESMB = 39,
1328         ZFS_PROP_REFQUOTA = 40,
1329         ZFS_PROP_REFRESERVATION = 41,
1330         ZFS_PROP_GUID = 42,
1331         ZFS_PROP_PRIMARYCACHE = 43,
1332         ZFS_PROP_SECONDARYCACHE = 44,
1333         ZFS_PROP_USEDSNAP = 45,
1334         ZFS_PROP_USEDDS = 46,
1335         ZFS_PROP_USEDCHILD = 47,
1336         ZFS_PROP_USEDREFRESERV = 48,
1337         ZFS_PROP_USERACCOUNTING = 49,
1338         ZFS_PROP_STMF_SHAREINFO = 50,
1339         ZFS_PROP_DEFER_DESTROY = 51,
1340         ZFS_PROP_USERREFS = 52,
1341         ZFS_PROP_LOGBIAS = 53,
1342         ZFS_PROP_UNIQUE = 54,
1343         ZFS_PROP_OBJSETID = 55,
1344         ZFS_PROP_DEDUP = 56,
1345         ZFS_PROP_MLSLABEL = 57,
1346         ZFS_PROP_SYNC = 58,
1347         ZFS_PROP_DNODESIZE = 59,
1348         ZFS_PROP_REFRATIO = 60,
1349         ZFS_PROP_WRITTEN = 61,
1350         ZFS_PROP_CLONES = 62,
1351         ZFS_PROP_LOGICALUSED = 63,
1352         ZFS_PROP_LOGICALREFERENCED = 64,
1353         ZFS_PROP_INCONSISTENT = 65,
1354         ZFS_PROP_VOLMODE = 66,
1355         ZFS_PROP_FILESYSTEM_LIMIT = 67,
1356         ZFS_PROP_SNAPSHOT_LIMIT = 68,
1357         ZFS_PROP_FILESYSTEM_COUNT = 69,
1358         ZFS_PROP_SNAPSHOT_COUNT = 70,
1359         ZFS_PROP_SNAPDEV = 71,
1360         ZFS_PROP_ACLTYPE = 72,
1361         ZFS_PROP_SELINUX_CONTEXT = 73,
1362         ZFS_PROP_SELINUX_FSCONTEXT = 74,
1363         ZFS_PROP_SELINUX_DEFCONTEXT = 75,
1364         ZFS_PROP_SELINUX_ROOTCONTEXT = 76,
1365         ZFS_PROP_RELATIME = 77,
1366         ZFS_PROP_REDUNDANT_METADATA = 78,
1367         ZFS_PROP_OVERLAY = 79,
1368         ZFS_PROP_PREV_SNAP = 80,
1369         ZFS_PROP_RECEIVE_RESUME_TOKEN = 81,
1370         ZFS_PROP_ENCRYPTION = 82,
1371         ZFS_PROP_KEYLOCATION = 83,
1372         ZFS_PROP_KEYFORMAT = 84,
1373         ZFS_PROP_PBKDF2_SALT = 85,
1374         ZFS_PROP_PBKDF2_ITERS = 86,
1375         ZFS_PROP_ENCRYPTION_ROOT = 87,
1376         ZFS_PROP_KEY_GUID = 88,
1377         ZFS_PROP_KEYSTATUS = 89,
1378         ZFS_PROP_REMAPTXG = 90,
1379         ZFS_PROP_SPECIAL_SMALL_BLOCKS = 91,
1380         ZFS_PROP_IVSET_GUID = 92,
1381         ZFS_NUM_PROPS = 93,
1382     }
1383     enum ZPROP_CONT = _Anonymous_19.ZPROP_CONT;
1384     enum ZPROP_INVAL = _Anonymous_19.ZPROP_INVAL;
1385     enum ZFS_PROP_TYPE = _Anonymous_19.ZFS_PROP_TYPE;
1386     enum ZFS_PROP_CREATION = _Anonymous_19.ZFS_PROP_CREATION;
1387     enum ZFS_PROP_USED = _Anonymous_19.ZFS_PROP_USED;
1388     enum ZFS_PROP_AVAILABLE = _Anonymous_19.ZFS_PROP_AVAILABLE;
1389     enum ZFS_PROP_REFERENCED = _Anonymous_19.ZFS_PROP_REFERENCED;
1390     enum ZFS_PROP_COMPRESSRATIO = _Anonymous_19.ZFS_PROP_COMPRESSRATIO;
1391     enum ZFS_PROP_MOUNTED = _Anonymous_19.ZFS_PROP_MOUNTED;
1392     enum ZFS_PROP_ORIGIN = _Anonymous_19.ZFS_PROP_ORIGIN;
1393     enum ZFS_PROP_QUOTA = _Anonymous_19.ZFS_PROP_QUOTA;
1394     enum ZFS_PROP_RESERVATION = _Anonymous_19.ZFS_PROP_RESERVATION;
1395     enum ZFS_PROP_VOLSIZE = _Anonymous_19.ZFS_PROP_VOLSIZE;
1396     enum ZFS_PROP_VOLBLOCKSIZE = _Anonymous_19.ZFS_PROP_VOLBLOCKSIZE;
1397     enum ZFS_PROP_RECORDSIZE = _Anonymous_19.ZFS_PROP_RECORDSIZE;
1398     enum ZFS_PROP_MOUNTPOINT = _Anonymous_19.ZFS_PROP_MOUNTPOINT;
1399     enum ZFS_PROP_SHARENFS = _Anonymous_19.ZFS_PROP_SHARENFS;
1400     enum ZFS_PROP_CHECKSUM = _Anonymous_19.ZFS_PROP_CHECKSUM;
1401     enum ZFS_PROP_COMPRESSION = _Anonymous_19.ZFS_PROP_COMPRESSION;
1402     enum ZFS_PROP_ATIME = _Anonymous_19.ZFS_PROP_ATIME;
1403     enum ZFS_PROP_DEVICES = _Anonymous_19.ZFS_PROP_DEVICES;
1404     enum ZFS_PROP_EXEC = _Anonymous_19.ZFS_PROP_EXEC;
1405     enum ZFS_PROP_SETUID = _Anonymous_19.ZFS_PROP_SETUID;
1406     enum ZFS_PROP_READONLY = _Anonymous_19.ZFS_PROP_READONLY;
1407     enum ZFS_PROP_ZONED = _Anonymous_19.ZFS_PROP_ZONED;
1408     enum ZFS_PROP_SNAPDIR = _Anonymous_19.ZFS_PROP_SNAPDIR;
1409     enum ZFS_PROP_PRIVATE = _Anonymous_19.ZFS_PROP_PRIVATE;
1410     enum ZFS_PROP_ACLINHERIT = _Anonymous_19.ZFS_PROP_ACLINHERIT;
1411     enum ZFS_PROP_CREATETXG = _Anonymous_19.ZFS_PROP_CREATETXG;
1412     enum ZFS_PROP_NAME = _Anonymous_19.ZFS_PROP_NAME;
1413     enum ZFS_PROP_CANMOUNT = _Anonymous_19.ZFS_PROP_CANMOUNT;
1414     enum ZFS_PROP_ISCSIOPTIONS = _Anonymous_19.ZFS_PROP_ISCSIOPTIONS;
1415     enum ZFS_PROP_XATTR = _Anonymous_19.ZFS_PROP_XATTR;
1416     enum ZFS_PROP_NUMCLONES = _Anonymous_19.ZFS_PROP_NUMCLONES;
1417     enum ZFS_PROP_COPIES = _Anonymous_19.ZFS_PROP_COPIES;
1418     enum ZFS_PROP_VERSION = _Anonymous_19.ZFS_PROP_VERSION;
1419     enum ZFS_PROP_UTF8ONLY = _Anonymous_19.ZFS_PROP_UTF8ONLY;
1420     enum ZFS_PROP_NORMALIZE = _Anonymous_19.ZFS_PROP_NORMALIZE;
1421     enum ZFS_PROP_CASE = _Anonymous_19.ZFS_PROP_CASE;
1422     enum ZFS_PROP_VSCAN = _Anonymous_19.ZFS_PROP_VSCAN;
1423     enum ZFS_PROP_NBMAND = _Anonymous_19.ZFS_PROP_NBMAND;
1424     enum ZFS_PROP_SHARESMB = _Anonymous_19.ZFS_PROP_SHARESMB;
1425     enum ZFS_PROP_REFQUOTA = _Anonymous_19.ZFS_PROP_REFQUOTA;
1426     enum ZFS_PROP_REFRESERVATION = _Anonymous_19.ZFS_PROP_REFRESERVATION;
1427     enum ZFS_PROP_GUID = _Anonymous_19.ZFS_PROP_GUID;
1428     enum ZFS_PROP_PRIMARYCACHE = _Anonymous_19.ZFS_PROP_PRIMARYCACHE;
1429     enum ZFS_PROP_SECONDARYCACHE = _Anonymous_19.ZFS_PROP_SECONDARYCACHE;
1430     enum ZFS_PROP_USEDSNAP = _Anonymous_19.ZFS_PROP_USEDSNAP;
1431     enum ZFS_PROP_USEDDS = _Anonymous_19.ZFS_PROP_USEDDS;
1432     enum ZFS_PROP_USEDCHILD = _Anonymous_19.ZFS_PROP_USEDCHILD;
1433     enum ZFS_PROP_USEDREFRESERV = _Anonymous_19.ZFS_PROP_USEDREFRESERV;
1434     enum ZFS_PROP_USERACCOUNTING = _Anonymous_19.ZFS_PROP_USERACCOUNTING;
1435     enum ZFS_PROP_STMF_SHAREINFO = _Anonymous_19.ZFS_PROP_STMF_SHAREINFO;
1436     enum ZFS_PROP_DEFER_DESTROY = _Anonymous_19.ZFS_PROP_DEFER_DESTROY;
1437     enum ZFS_PROP_USERREFS = _Anonymous_19.ZFS_PROP_USERREFS;
1438     enum ZFS_PROP_LOGBIAS = _Anonymous_19.ZFS_PROP_LOGBIAS;
1439     enum ZFS_PROP_UNIQUE = _Anonymous_19.ZFS_PROP_UNIQUE;
1440     enum ZFS_PROP_OBJSETID = _Anonymous_19.ZFS_PROP_OBJSETID;
1441     enum ZFS_PROP_DEDUP = _Anonymous_19.ZFS_PROP_DEDUP;
1442     enum ZFS_PROP_MLSLABEL = _Anonymous_19.ZFS_PROP_MLSLABEL;
1443     enum ZFS_PROP_SYNC = _Anonymous_19.ZFS_PROP_SYNC;
1444     enum ZFS_PROP_DNODESIZE = _Anonymous_19.ZFS_PROP_DNODESIZE;
1445     enum ZFS_PROP_REFRATIO = _Anonymous_19.ZFS_PROP_REFRATIO;
1446     enum ZFS_PROP_WRITTEN = _Anonymous_19.ZFS_PROP_WRITTEN;
1447     enum ZFS_PROP_CLONES = _Anonymous_19.ZFS_PROP_CLONES;
1448     enum ZFS_PROP_LOGICALUSED = _Anonymous_19.ZFS_PROP_LOGICALUSED;
1449     enum ZFS_PROP_LOGICALREFERENCED = _Anonymous_19.ZFS_PROP_LOGICALREFERENCED;
1450     enum ZFS_PROP_INCONSISTENT = _Anonymous_19.ZFS_PROP_INCONSISTENT;
1451     enum ZFS_PROP_VOLMODE = _Anonymous_19.ZFS_PROP_VOLMODE;
1452     enum ZFS_PROP_FILESYSTEM_LIMIT = _Anonymous_19.ZFS_PROP_FILESYSTEM_LIMIT;
1453     enum ZFS_PROP_SNAPSHOT_LIMIT = _Anonymous_19.ZFS_PROP_SNAPSHOT_LIMIT;
1454     enum ZFS_PROP_FILESYSTEM_COUNT = _Anonymous_19.ZFS_PROP_FILESYSTEM_COUNT;
1455     enum ZFS_PROP_SNAPSHOT_COUNT = _Anonymous_19.ZFS_PROP_SNAPSHOT_COUNT;
1456     enum ZFS_PROP_SNAPDEV = _Anonymous_19.ZFS_PROP_SNAPDEV;
1457     enum ZFS_PROP_ACLTYPE = _Anonymous_19.ZFS_PROP_ACLTYPE;
1458     enum ZFS_PROP_SELINUX_CONTEXT = _Anonymous_19.ZFS_PROP_SELINUX_CONTEXT;
1459     enum ZFS_PROP_SELINUX_FSCONTEXT = _Anonymous_19.ZFS_PROP_SELINUX_FSCONTEXT;
1460     enum ZFS_PROP_SELINUX_DEFCONTEXT = _Anonymous_19.ZFS_PROP_SELINUX_DEFCONTEXT;
1461     enum ZFS_PROP_SELINUX_ROOTCONTEXT = _Anonymous_19.ZFS_PROP_SELINUX_ROOTCONTEXT;
1462     enum ZFS_PROP_RELATIME = _Anonymous_19.ZFS_PROP_RELATIME;
1463     enum ZFS_PROP_REDUNDANT_METADATA = _Anonymous_19.ZFS_PROP_REDUNDANT_METADATA;
1464     enum ZFS_PROP_OVERLAY = _Anonymous_19.ZFS_PROP_OVERLAY;
1465     enum ZFS_PROP_PREV_SNAP = _Anonymous_19.ZFS_PROP_PREV_SNAP;
1466     enum ZFS_PROP_RECEIVE_RESUME_TOKEN = _Anonymous_19.ZFS_PROP_RECEIVE_RESUME_TOKEN;
1467     enum ZFS_PROP_ENCRYPTION = _Anonymous_19.ZFS_PROP_ENCRYPTION;
1468     enum ZFS_PROP_KEYLOCATION = _Anonymous_19.ZFS_PROP_KEYLOCATION;
1469     enum ZFS_PROP_KEYFORMAT = _Anonymous_19.ZFS_PROP_KEYFORMAT;
1470     enum ZFS_PROP_PBKDF2_SALT = _Anonymous_19.ZFS_PROP_PBKDF2_SALT;
1471     enum ZFS_PROP_PBKDF2_ITERS = _Anonymous_19.ZFS_PROP_PBKDF2_ITERS;
1472     enum ZFS_PROP_ENCRYPTION_ROOT = _Anonymous_19.ZFS_PROP_ENCRYPTION_ROOT;
1473     enum ZFS_PROP_KEY_GUID = _Anonymous_19.ZFS_PROP_KEY_GUID;
1474     enum ZFS_PROP_KEYSTATUS = _Anonymous_19.ZFS_PROP_KEYSTATUS;
1475     enum ZFS_PROP_REMAPTXG = _Anonymous_19.ZFS_PROP_REMAPTXG;
1476     enum ZFS_PROP_SPECIAL_SMALL_BLOCKS = _Anonymous_19.ZFS_PROP_SPECIAL_SMALL_BLOCKS;
1477     enum ZFS_PROP_IVSET_GUID = _Anonymous_19.ZFS_PROP_IVSET_GUID;
1478     enum ZFS_NUM_PROPS = _Anonymous_19.ZFS_NUM_PROPS;
1479     alias zfs_prop_t = _Anonymous_19;
1480     enum dmu_objset_type
1481     {
1482         DMU_OST_NONE = 0,
1483         DMU_OST_META = 1,
1484         DMU_OST_ZFS = 2,
1485         DMU_OST_ZVOL = 3,
1486         DMU_OST_OTHER = 4,
1487         DMU_OST_ANY = 5,
1488         DMU_OST_NUMTYPES = 6,
1489     }
1490     enum DMU_OST_NONE = dmu_objset_type.DMU_OST_NONE;
1491     enum DMU_OST_META = dmu_objset_type.DMU_OST_META;
1492     enum DMU_OST_ZFS = dmu_objset_type.DMU_OST_ZFS;
1493     enum DMU_OST_ZVOL = dmu_objset_type.DMU_OST_ZVOL;
1494     enum DMU_OST_OTHER = dmu_objset_type.DMU_OST_OTHER;
1495     enum DMU_OST_ANY = dmu_objset_type.DMU_OST_ANY;
1496     enum DMU_OST_NUMTYPES = dmu_objset_type.DMU_OST_NUMTYPES;
1497     alias dmu_objset_type_t = dmu_objset_type;
1498     enum _Anonymous_20
1499     {
1500         ZFS_TYPE_FILESYSTEM = 1,
1501         ZFS_TYPE_SNAPSHOT = 2,
1502         ZFS_TYPE_VOLUME = 4,
1503         ZFS_TYPE_POOL = 8,
1504         ZFS_TYPE_BOOKMARK = 16,
1505     }
1506     enum ZFS_TYPE_FILESYSTEM = _Anonymous_20.ZFS_TYPE_FILESYSTEM;
1507     enum ZFS_TYPE_SNAPSHOT = _Anonymous_20.ZFS_TYPE_SNAPSHOT;
1508     enum ZFS_TYPE_VOLUME = _Anonymous_20.ZFS_TYPE_VOLUME;
1509     enum ZFS_TYPE_POOL = _Anonymous_20.ZFS_TYPE_POOL;
1510     enum ZFS_TYPE_BOOKMARK = _Anonymous_20.ZFS_TYPE_BOOKMARK;
1511     alias zfs_type_t = _Anonymous_20;
1512     int nvpair_value_match(nvpair*, int, char*, char**) @nogc nothrow;
1513     int nvpair_value_match_regex(nvpair*, int, char*, re_pattern_buffer*, char**) @nogc nothrow;
1514     void nvlist_print(_IO_FILE*, nvlist*) @nogc nothrow;
1515     int nvlist_print_json(_IO_FILE*, nvlist*) @nogc nothrow;
1516     void dump_nvlist(nvlist*, int) @nogc nothrow;
1517     alias nvlist_prtctl_t = nvlist_prtctl*;
1518     struct nvlist_prtctl;
1519     enum nvlist_indent_mode
1520     {
1521         NVLIST_INDENT_ABS = 0,
1522         NVLIST_INDENT_TABBED = 1,
1523     }
1524     enum NVLIST_INDENT_ABS = nvlist_indent_mode.NVLIST_INDENT_ABS;
1525     enum NVLIST_INDENT_TABBED = nvlist_indent_mode.NVLIST_INDENT_TABBED;
1526     nvlist_prtctl* nvlist_prtctl_alloc() @nogc nothrow;
1527     void nvlist_prtctl_free(nvlist_prtctl*) @nogc nothrow;
1528     void nvlist_prt(nvlist*, nvlist_prtctl*) @nogc nothrow;
1529     void nvlist_prtctl_setdest(nvlist_prtctl*, _IO_FILE*) @nogc nothrow;
1530     _IO_FILE* nvlist_prtctl_getdest(nvlist_prtctl*) @nogc nothrow;
1531     void nvlist_prtctl_setindent(nvlist_prtctl*, nvlist_indent_mode, int, int) @nogc nothrow;
1532     void nvlist_prtctl_doindent(nvlist_prtctl*, int) @nogc nothrow;
1533     enum nvlist_prtctl_fmt
1534     {
1535         NVLIST_FMT_MEMBER_NAME = 0,
1536         NVLIST_FMT_MEMBER_POSTAMBLE = 1,
1537         NVLIST_FMT_BTWN_ARRAY = 2,
1538     }
1539     enum NVLIST_FMT_MEMBER_NAME = nvlist_prtctl_fmt.NVLIST_FMT_MEMBER_NAME;
1540     enum NVLIST_FMT_MEMBER_POSTAMBLE = nvlist_prtctl_fmt.NVLIST_FMT_MEMBER_POSTAMBLE;
1541     enum NVLIST_FMT_BTWN_ARRAY = nvlist_prtctl_fmt.NVLIST_FMT_BTWN_ARRAY;
1542     void nvlist_prtctl_setfmt(nvlist_prtctl*, nvlist_prtctl_fmt, const(char)*) @nogc nothrow;
1543     void nvlist_prtctl_dofmt(nvlist_prtctl*, nvlist_prtctl_fmt, ...) @nogc nothrow;
1544     alias wchar_t = int;
1545     void nvlist_prtctlop_boolean(nvlist_prtctl*, int function(nvlist_prtctl*, void*, nvlist*, const(char)*, int), void*) @nogc nothrow;
1546     void nvlist_prtctlop_boolean_value(nvlist_prtctl*, int function(nvlist_prtctl*, void*, nvlist*, const(char)*, int), void*) @nogc nothrow;
1547     void nvlist_prtctlop_byte(nvlist_prtctl*, int function(nvlist_prtctl*, void*, nvlist*, const(char)*, ubyte), void*) @nogc nothrow;
1548     void nvlist_prtctlop_int8(nvlist_prtctl*, int function(nvlist_prtctl*, void*, nvlist*, const(char)*, byte), void*) @nogc nothrow;
1549     void nvlist_prtctlop_uint8(nvlist_prtctl*, int function(nvlist_prtctl*, void*, nvlist*, const(char)*, ubyte), void*) @nogc nothrow;
1550     void nvlist_prtctlop_int16(nvlist_prtctl*, int function(nvlist_prtctl*, void*, nvlist*, const(char)*, short), void*) @nogc nothrow;
1551     void nvlist_prtctlop_uint16(nvlist_prtctl*, int function(nvlist_prtctl*, void*, nvlist*, const(char)*, ushort), void*) @nogc nothrow;
1552     void nvlist_prtctlop_int32(nvlist_prtctl*, int function(nvlist_prtctl*, void*, nvlist*, const(char)*, int), void*) @nogc nothrow;
1553     void nvlist_prtctlop_uint32(nvlist_prtctl*, int function(nvlist_prtctl*, void*, nvlist*, const(char)*, uint), void*) @nogc nothrow;
1554     void nvlist_prtctlop_int64(nvlist_prtctl*, int function(nvlist_prtctl*, void*, nvlist*, const(char)*, c_long), void*) @nogc nothrow;
1555     void nvlist_prtctlop_uint64(nvlist_prtctl*, int function(nvlist_prtctl*, void*, nvlist*, const(char)*, ulong), void*) @nogc nothrow;
1556     void nvlist_prtctlop_double(nvlist_prtctl*, int function(nvlist_prtctl*, void*, nvlist*, const(char)*, double), void*) @nogc nothrow;
1557     void nvlist_prtctlop_string(nvlist_prtctl*, int function(nvlist_prtctl*, void*, nvlist*, const(char)*, char*), void*) @nogc nothrow;
1558     void nvlist_prtctlop_hrtime(nvlist_prtctl*, int function(nvlist_prtctl*, void*, nvlist*, const(char)*, ulong), void*) @nogc nothrow;
1559     void nvlist_prtctlop_nvlist(nvlist_prtctl*, int function(nvlist_prtctl*, void*, nvlist*, const(char)*, nvlist*), void*) @nogc nothrow;
1560     void nvlist_prtctlop_boolean_array(nvlist_prtctl*, int function(nvlist_prtctl*, void*, nvlist*, const(char)*, int*, uint), void*) @nogc nothrow;
1561     void nvlist_prtctlop_byte_array(nvlist_prtctl*, int function(nvlist_prtctl*, void*, nvlist*, const(char)*, ubyte*, uint), void*) @nogc nothrow;
1562     void nvlist_prtctlop_int8_array(nvlist_prtctl*, int function(nvlist_prtctl*, void*, nvlist*, const(char)*, byte*, uint), void*) @nogc nothrow;
1563     void nvlist_prtctlop_uint8_array(nvlist_prtctl*, int function(nvlist_prtctl*, void*, nvlist*, const(char)*, ubyte*, uint), void*) @nogc nothrow;
1564     void nvlist_prtctlop_int16_array(nvlist_prtctl*, int function(nvlist_prtctl*, void*, nvlist*, const(char)*, short*, uint), void*) @nogc nothrow;
1565     void nvlist_prtctlop_uint16_array(nvlist_prtctl*, int function(nvlist_prtctl*, void*, nvlist*, const(char)*, ushort*, uint), void*) @nogc nothrow;
1566     void nvlist_prtctlop_int32_array(nvlist_prtctl*, int function(nvlist_prtctl*, void*, nvlist*, const(char)*, int*, uint), void*) @nogc nothrow;
1567     void nvlist_prtctlop_uint32_array(nvlist_prtctl*, int function(nvlist_prtctl*, void*, nvlist*, const(char)*, uint*, uint), void*) @nogc nothrow;
1568     void nvlist_prtctlop_int64_array(nvlist_prtctl*, int function(nvlist_prtctl*, void*, nvlist*, const(char)*, c_long*, uint), void*) @nogc nothrow;
1569     void nvlist_prtctlop_uint64_array(nvlist_prtctl*, int function(nvlist_prtctl*, void*, nvlist*, const(char)*, ulong*, uint), void*) @nogc nothrow;
1570     void nvlist_prtctlop_string_array(nvlist_prtctl*, int function(nvlist_prtctl*, void*, nvlist*, const(char)*, char**, uint), void*) @nogc nothrow;
1571     void nvlist_prtctlop_nvlist_array(nvlist_prtctl*, int function(nvlist_prtctl*, void*, nvlist*, const(char)*, nvlist**, uint), void*) @nogc nothrow;
1572     int libzfs_core_init() @nogc nothrow;
1573     void libzfs_core_fini() @nogc nothrow;
1574     enum lzc_dataset_type
1575     {
1576         LZC_DATSET_TYPE_ZFS = 2,
1577         LZC_DATSET_TYPE_ZVOL = 3,
1578     }
1579     enum LZC_DATSET_TYPE_ZFS = lzc_dataset_type.LZC_DATSET_TYPE_ZFS;
1580     enum LZC_DATSET_TYPE_ZVOL = lzc_dataset_type.LZC_DATSET_TYPE_ZVOL;
1581     int lzc_remap(const(char)*) @nogc nothrow;
1582     int lzc_snapshot(nvlist*, nvlist*, nvlist**) @nogc nothrow;
1583     int lzc_create(const(char)*, lzc_dataset_type, nvlist*, ubyte*, uint) @nogc nothrow;
1584     int lzc_clone(const(char)*, const(char)*, nvlist*) @nogc nothrow;
1585     int lzc_promote(const(char)*, char*, int) @nogc nothrow;
1586     int lzc_destroy_snaps(nvlist*, int, nvlist**) @nogc nothrow;
1587     int lzc_bookmark(nvlist*, nvlist**) @nogc nothrow;
1588     int lzc_get_bookmarks(const(char)*, nvlist*, nvlist**) @nogc nothrow;
1589     int lzc_destroy_bookmarks(nvlist*, nvlist**) @nogc nothrow;
1590     int lzc_load_key(const(char)*, int, ubyte*, uint) @nogc nothrow;
1591     int lzc_unload_key(const(char)*) @nogc nothrow;
1592     int lzc_change_key(const(char)*, ulong, nvlist*, ubyte*, uint) @nogc nothrow;
1593     int lzc_initialize(const(char)*, pool_initialize_func, nvlist*, nvlist**) @nogc nothrow;
1594     int lzc_trim(const(char)*, pool_trim_func, ulong, int, nvlist*, nvlist**) @nogc nothrow;
1595     int lzc_snaprange_space(const(char)*, const(char)*, ulong*) @nogc nothrow;
1596     int lzc_hold(nvlist*, int, nvlist**) @nogc nothrow;
1597     int lzc_release(nvlist*, nvlist**) @nogc nothrow;
1598     int lzc_get_holds(const(char)*, nvlist**) @nogc nothrow;
1599     enum lzc_send_flags
1600     {
1601         LZC_SEND_FLAG_EMBED_DATA = 1,
1602         LZC_SEND_FLAG_LARGE_BLOCK = 2,
1603         LZC_SEND_FLAG_COMPRESS = 4,
1604         LZC_SEND_FLAG_RAW = 8,
1605     }
1606     enum LZC_SEND_FLAG_EMBED_DATA = lzc_send_flags.LZC_SEND_FLAG_EMBED_DATA;
1607     enum LZC_SEND_FLAG_LARGE_BLOCK = lzc_send_flags.LZC_SEND_FLAG_LARGE_BLOCK;
1608     enum LZC_SEND_FLAG_COMPRESS = lzc_send_flags.LZC_SEND_FLAG_COMPRESS;
1609     enum LZC_SEND_FLAG_RAW = lzc_send_flags.LZC_SEND_FLAG_RAW;
1610     int lzc_send(const(char)*, const(char)*, int, lzc_send_flags) @nogc nothrow;
1611     int lzc_send_resume(const(char)*, const(char)*, int, lzc_send_flags, ulong, ulong) @nogc nothrow;
1612     int lzc_send_space(const(char)*, const(char)*, lzc_send_flags, ulong*) @nogc nothrow;
1613     struct dmu_replay_record;
1614     int lzc_receive(const(char)*, nvlist*, const(char)*, int, int, int) @nogc nothrow;
1615     int lzc_receive_resumable(const(char)*, nvlist*, const(char)*, int, int, int) @nogc nothrow;
1616     int lzc_receive_with_header(const(char)*, nvlist*, const(char)*, int, int, int, int, const(dmu_replay_record)*) @nogc nothrow;
1617     int lzc_receive_one(const(char)*, nvlist*, const(char)*, int, int, int, int, const(dmu_replay_record)*, int, ulong*, ulong*, ulong*, nvlist**) @nogc nothrow;
1618     int lzc_receive_with_cmdprops(const(char)*, nvlist*, nvlist*, ubyte*, uint, const(char)*, int, int, int, int, const(dmu_replay_record)*, int, ulong*, ulong*, ulong*, nvlist**) @nogc nothrow;
1619     int lzc_exists(const(char)*) @nogc nothrow;
1620     int lzc_rollback(const(char)*, char*, int) @nogc nothrow;
1621     int lzc_rollback_to(const(char)*, const(char)*) @nogc nothrow;
1622     int lzc_rename(const(char)*, const(char)*) @nogc nothrow;
1623     int lzc_destroy(const(char)*) @nogc nothrow;
1624     int lzc_channel_program(const(char)*, const(char)*, ulong, ulong, nvlist*, nvlist**) @nogc nothrow;
1625     int lzc_channel_program_nosync(const(char)*, const(char)*, ulong, ulong, nvlist*, nvlist**) @nogc nothrow;
1626     int lzc_sync(const(char)*, nvlist*, nvlist**) @nogc nothrow;
1627     int lzc_reopen(const(char)*, int) @nogc nothrow;
1628     int lzc_pool_checkpoint(const(char)*) @nogc nothrow;
1629     int lzc_pool_checkpoint_discard(const(char)*) @nogc nothrow;
1630     pragma(mangle, "alloca") void* alloca_(c_ulong) @nogc nothrow;
1631     alias size_t = c_ulong;
1632     struct ucontext_t
1633     {
1634         @DppOffsetSize(0,8) c_ulong uc_flags;
1635         @DppOffsetSize(8,8) ucontext_t* uc_link;
1636         @DppOffsetSize(16,24) stack_t uc_stack;
1637         @DppOffsetSize(40,256) mcontext_t uc_mcontext;
1638         @DppOffsetSize(296,128) __sigset_t uc_sigmask;
1639         @DppOffsetSize(424,512) _libc_fpstate __fpregs_mem;
1640         @DppOffsetSize(936,32) ulong[4] __ssp;
1641     }
1642     struct mcontext_t
1643     {
1644         @DppOffsetSize(0,184) long[23] gregs;
1645         @DppOffsetSize(184,8) _libc_fpstate* fpregs;
1646         @DppOffsetSize(192,64) ulong[8] __reserved1;
1647     }
1648     alias fpregset_t = _libc_fpstate*;
1649     struct _libc_fpstate
1650     {
1651         @DppOffsetSize(0,2) ushort cwd;
1652         @DppOffsetSize(2,2) ushort swd;
1653         @DppOffsetSize(4,2) ushort ftw;
1654         @DppOffsetSize(6,2) ushort fop;
1655         @DppOffsetSize(8,8) c_ulong rip;
1656         @DppOffsetSize(16,8) c_ulong rdp;
1657         @DppOffsetSize(24,4) uint mxcsr;
1658         @DppOffsetSize(28,4) uint mxcr_mask;
1659         @DppOffsetSize(32,128) _libc_fpxreg[8] _st;
1660         @DppOffsetSize(160,256) _libc_xmmreg[16] _xmm;
1661         @DppOffsetSize(416,96) uint[24] __glibc_reserved1;
1662     }
1663     struct _libc_xmmreg
1664     {
1665         @DppOffsetSize(0,16) uint[4] element;
1666     }
1667     struct _libc_fpxreg
1668     {
1669         @DppOffsetSize(0,8) ushort[4] significand;
1670         @DppOffsetSize(8,2) ushort exponent;
1671         @DppOffsetSize(10,6) ushort[3] __glibc_reserved1;
1672     }
1673     alias gregset_t = long[23];
1674     alias greg_t = long;
1675     alias fsfilcnt_t = c_ulong;
1676     alias fsblkcnt_t = c_ulong;
1677     alias blkcnt_t = c_long;
1678     alias blksize_t = c_long;
1679     alias register_t = c_long;
1680     alias u_int64_t = c_ulong;
1681     alias u_int32_t = uint;
1682     alias u_int16_t = ushort;
1683     alias u_int8_t = ubyte;
1684     alias key_t = int;
1685     alias caddr_t = char*;
1686     alias daddr_t = int;
1687     alias ssize_t = c_long;
1688     alias id_t = uint;
1689     alias pid_t = int;
1690     alias off_t = c_long;
1691     alias uid_t = uint;
1692     alias nlink_t = c_ulong;
1693     alias mode_t = uint;
1694     alias gid_t = uint;
1695     alias dev_t = c_ulong;
1696     alias ino_t = c_ulong;
1697     alias loff_t = c_long;
1698     alias fsid_t = __fsid_t;
1699     alias u_quad_t = c_ulong;
1700     alias quad_t = c_long;
1701     alias u_long = c_ulong;
1702     alias u_int = uint;
1703     alias u_short = ushort;
1704     alias u_char = ubyte;
1705     int futimes(int, const(timeval)*) @nogc nothrow;
1706     int lutimes(const(char)*, const(timeval)*) @nogc nothrow;
1707     int utimes(const(char)*, const(timeval)*) @nogc nothrow;
1708     int setitimer(int, const(itimerval)*, itimerval*) @nogc nothrow;
1709     int getitimer(int, itimerval*) @nogc nothrow;
1710     alias __itimer_which_t = int;
1711     struct itimerval
1712     {
1713         @DppOffsetSize(0,16) timeval it_interval;
1714         @DppOffsetSize(16,16) timeval it_value;
1715     }
1716     enum __itimer_which
1717     {
1718         ITIMER_REAL = 0,
1719         ITIMER_VIRTUAL = 1,
1720         ITIMER_PROF = 2,
1721     }
1722     enum ITIMER_REAL = __itimer_which.ITIMER_REAL;
1723     enum ITIMER_VIRTUAL = __itimer_which.ITIMER_VIRTUAL;
1724     enum ITIMER_PROF = __itimer_which.ITIMER_PROF;
1725     int adjtime(const(timeval)*, timeval*) @nogc nothrow;
1726     int settimeofday(const(timeval)*, const(timezone)*) @nogc nothrow;
1727     int gettimeofday(timeval*, timezone*) @nogc nothrow;
1728     alias __timezone_ptr_t = timezone*;
1729     struct timezone
1730     {
1731         @DppOffsetSize(0,4) int tz_minuteswest;
1732         @DppOffsetSize(4,4) int tz_dsttime;
1733     }
1734     alias _Float32 = float;
1735     alias _Float64 = double;
1736     alias _Float32x = double;
1737     int pselect(int, fd_set*, fd_set*, fd_set*, const(timespec)*, const(__sigset_t)*) @nogc nothrow;
1738     alias _Float64x = real;
1739     int select(int, fd_set*, fd_set*, fd_set*, timeval*) @nogc nothrow;
1740     alias fd_mask = c_long;
1741     struct fd_set
1742     {
1743         @DppOffsetSize(0,128) c_long[16] __fds_bits;
1744     }
1745     alias __fd_mask = c_long;
1746     alias suseconds_t = c_long;
1747     int getloadavg(double*, int) @nogc nothrow;
1748     int getsubopt(char**, char**, char**) @nogc nothrow;
1749     struct __pthread_rwlock_arch_t
1750     {
1751         @DppOffsetSize(0,4) uint __readers;
1752         @DppOffsetSize(4,4) uint __writers;
1753         @DppOffsetSize(8,4) uint __wrphase_futex;
1754         @DppOffsetSize(12,4) uint __writers_futex;
1755         @DppOffsetSize(16,4) uint __pad3;
1756         @DppOffsetSize(20,4) uint __pad4;
1757         @DppOffsetSize(24,4) int __cur_writer;
1758         @DppOffsetSize(28,4) int __shared;
1759         @DppOffsetSize(32,1) byte __rwelision;
1760         @DppOffsetSize(33,7) ubyte[7] __pad1;
1761         @DppOffsetSize(40,8) c_ulong __pad2;
1762         @DppOffsetSize(48,4) uint __flags;
1763     }
1764     int rpmatch(const(char)*) @nogc nothrow;
1765     alias pthread_t = c_ulong;
1766     union pthread_mutexattr_t
1767     {
1768         @DppOffsetSize(0,4) char[4] __size;
1769         @DppOffsetSize(0,4) int __align;
1770     }
1771     union pthread_condattr_t
1772     {
1773         @DppOffsetSize(0,4) char[4] __size;
1774         @DppOffsetSize(0,4) int __align;
1775     }
1776     alias pthread_key_t = uint;
1777     alias pthread_once_t = int;
1778     union pthread_attr_t
1779     {
1780         @DppOffsetSize(0,56) char[56] __size;
1781         @DppOffsetSize(0,8) c_long __align;
1782     }
1783     union pthread_mutex_t
1784     {
1785         @DppOffsetSize(0,40) __pthread_mutex_s __data;
1786         @DppOffsetSize(0,40) char[40] __size;
1787         @DppOffsetSize(0,8) c_long __align;
1788     }
1789     union pthread_cond_t
1790     {
1791         @DppOffsetSize(0,48) __pthread_cond_s __data;
1792         @DppOffsetSize(0,48) char[48] __size;
1793         @DppOffsetSize(0,8) long __align;
1794     }
1795     union pthread_rwlock_t
1796     {
1797         @DppOffsetSize(0,56) __pthread_rwlock_arch_t __data;
1798         @DppOffsetSize(0,56) char[56] __size;
1799         @DppOffsetSize(0,8) c_long __align;
1800     }
1801     union pthread_rwlockattr_t
1802     {
1803         @DppOffsetSize(0,8) char[8] __size;
1804         @DppOffsetSize(0,8) c_long __align;
1805     }
1806     alias pthread_spinlock_t = int;
1807     union pthread_barrier_t
1808     {
1809         @DppOffsetSize(0,32) char[32] __size;
1810         @DppOffsetSize(0,8) c_long __align;
1811     }
1812     union pthread_barrierattr_t
1813     {
1814         @DppOffsetSize(0,4) char[4] __size;
1815         @DppOffsetSize(0,4) int __align;
1816     }
1817     c_ulong wcstombs(char*, const(int)*, c_ulong) @nogc nothrow;
1818     c_ulong mbstowcs(int*, const(char)*, c_ulong) @nogc nothrow;
1819     int wctomb(char*, int) @nogc nothrow;
1820     struct sigaction
1821     {
1822         static union _Anonymous_21
1823         {
1824             @DppOffsetSize(0,8) void function(int) sa_handler;
1825             @DppOffsetSize(0,8) void function(int, siginfo_t*, void*) sa_sigaction;
1826         }
1827         @DppOffsetSize(0,8) _Anonymous_21 __sigaction_handler;
1828         @DppOffsetSize(8,128) __sigset_t sa_mask;
1829         @DppOffsetSize(136,4) int sa_flags;
1830         @DppOffsetSize(144,8) void function() sa_restorer;
1831     }
1832     int mbtowc(int*, const(char)*, c_ulong) @nogc nothrow;
1833     int mblen(const(char)*, c_ulong) @nogc nothrow;
1834     int qfcvt_r(real, int, int*, int*, char*, c_ulong) @nogc nothrow;
1835     int qecvt_r(real, int, int*, int*, char*, c_ulong) @nogc nothrow;
1836     int fcvt_r(double, int, int*, int*, char*, c_ulong) @nogc nothrow;
1837     int ecvt_r(double, int, int*, int*, char*, c_ulong) @nogc nothrow;
1838     char* qgcvt(real, int, char*) @nogc nothrow;
1839     struct _fpx_sw_bytes
1840     {
1841         @DppOffsetSize(0,4) uint magic1;
1842         @DppOffsetSize(4,4) uint extended_size;
1843         @DppOffsetSize(8,8) c_ulong xstate_bv;
1844         @DppOffsetSize(16,4) uint xstate_size;
1845         @DppOffsetSize(20,28) uint[7] __glibc_reserved1;
1846     }
1847     struct _fpreg
1848     {
1849         @DppOffsetSize(0,8) ushort[4] significand;
1850         @DppOffsetSize(8,2) ushort exponent;
1851     }
1852     struct _fpxreg
1853     {
1854         @DppOffsetSize(0,8) ushort[4] significand;
1855         @DppOffsetSize(8,2) ushort exponent;
1856         @DppOffsetSize(10,6) ushort[3] __glibc_reserved1;
1857     }
1858     struct _xmmreg
1859     {
1860         @DppOffsetSize(0,16) uint[4] element;
1861     }
1862     struct _fpstate
1863     {
1864         @DppOffsetSize(0,2) ushort cwd;
1865         @DppOffsetSize(2,2) ushort swd;
1866         @DppOffsetSize(4,2) ushort ftw;
1867         @DppOffsetSize(6,2) ushort fop;
1868         @DppOffsetSize(8,8) c_ulong rip;
1869         @DppOffsetSize(16,8) c_ulong rdp;
1870         @DppOffsetSize(24,4) uint mxcsr;
1871         @DppOffsetSize(28,4) uint mxcr_mask;
1872         @DppOffsetSize(32,128) _fpxreg[8] _st;
1873         @DppOffsetSize(160,256) _xmmreg[16] _xmm;
1874         @DppOffsetSize(416,96) uint[24] __glibc_reserved1;
1875     }
1876     struct sigcontext
1877     {
1878         @DppOffsetSize(0,8) c_ulong r8;
1879         @DppOffsetSize(8,8) c_ulong r9;
1880         @DppOffsetSize(16,8) c_ulong r10;
1881         @DppOffsetSize(24,8) c_ulong r11;
1882         @DppOffsetSize(32,8) c_ulong r12;
1883         @DppOffsetSize(40,8) c_ulong r13;
1884         @DppOffsetSize(48,8) c_ulong r14;
1885         @DppOffsetSize(56,8) c_ulong r15;
1886         @DppOffsetSize(64,8) c_ulong rdi;
1887         @DppOffsetSize(72,8) c_ulong rsi;
1888         @DppOffsetSize(80,8) c_ulong rbp;
1889         @DppOffsetSize(88,8) c_ulong rbx;
1890         @DppOffsetSize(96,8) c_ulong rdx;
1891         @DppOffsetSize(104,8) c_ulong rax;
1892         @DppOffsetSize(112,8) c_ulong rcx;
1893         @DppOffsetSize(120,8) c_ulong rsp;
1894         @DppOffsetSize(128,8) c_ulong rip;
1895         @DppOffsetSize(136,8) c_ulong eflags;
1896         @DppOffsetSize(144,2) ushort cs;
1897         @DppOffsetSize(146,2) ushort gs;
1898         @DppOffsetSize(148,2) ushort fs;
1899         @DppOffsetSize(150,2) ushort __pad0;
1900         @DppOffsetSize(152,8) c_ulong err;
1901         @DppOffsetSize(160,8) c_ulong trapno;
1902         @DppOffsetSize(168,8) c_ulong oldmask;
1903         @DppOffsetSize(176,8) c_ulong cr2;
1904         static union _Anonymous_22
1905         {
1906             @DppOffsetSize(0,8) _fpstate* fpstate;
1907             @DppOffsetSize(0,8) c_ulong __fpstate_word;
1908         }
1909         _Anonymous_22 _anonymous_23;
1910         auto fpstate() @property @nogc pure nothrow { return _anonymous_23.fpstate; }
1911         void fpstate(_T_)(auto ref _T_ val) @property @nogc pure nothrow { _anonymous_23.fpstate = val; }
1912         auto __fpstate_word() @property @nogc pure nothrow { return _anonymous_23.__fpstate_word; }
1913         void __fpstate_word(_T_)(auto ref _T_ val) @property @nogc pure nothrow { _anonymous_23.__fpstate_word = val; }
1914         @DppOffsetSize(192,64) c_ulong[8] __reserved1;
1915     }
1916     struct _xsave_hdr
1917     {
1918         @DppOffsetSize(0,8) c_ulong xstate_bv;
1919         @DppOffsetSize(8,16) c_ulong[2] __glibc_reserved1;
1920         @DppOffsetSize(24,40) c_ulong[5] __glibc_reserved2;
1921     }
1922     struct _ymmh_state
1923     {
1924         @DppOffsetSize(0,256) uint[64] ymmh_space;
1925     }
1926     struct _xstate
1927     {
1928         @DppOffsetSize(0,512) _fpstate fpstate;
1929         @DppOffsetSize(512,64) _xsave_hdr xstate_hdr;
1930         @DppOffsetSize(576,256) _ymmh_state ymmh;
1931     }
1932     enum _Anonymous_24
1933     {
1934         SIGEV_SIGNAL = 0,
1935         SIGEV_NONE = 1,
1936         SIGEV_THREAD = 2,
1937         SIGEV_THREAD_ID = 4,
1938     }
1939     enum SIGEV_SIGNAL = _Anonymous_24.SIGEV_SIGNAL;
1940     enum SIGEV_NONE = _Anonymous_24.SIGEV_NONE;
1941     enum SIGEV_THREAD = _Anonymous_24.SIGEV_THREAD;
1942     enum SIGEV_THREAD_ID = _Anonymous_24.SIGEV_THREAD_ID;
1943     char* qfcvt(real, int, int*, int*) @nogc nothrow;
1944     char* qecvt(real, int, int*, int*) @nogc nothrow;
1945     enum _Anonymous_25
1946     {
1947         SI_ASYNCNL = -60,
1948         SI_DETHREAD = -7,
1949         SI_TKILL = -6,
1950         SI_SIGIO = -5,
1951         SI_ASYNCIO = -4,
1952         SI_MESGQ = -3,
1953         SI_TIMER = -2,
1954         SI_QUEUE = -1,
1955         SI_USER = 0,
1956         SI_KERNEL = 128,
1957     }
1958     enum SI_ASYNCNL = _Anonymous_25.SI_ASYNCNL;
1959     enum SI_DETHREAD = _Anonymous_25.SI_DETHREAD;
1960     enum SI_TKILL = _Anonymous_25.SI_TKILL;
1961     enum SI_SIGIO = _Anonymous_25.SI_SIGIO;
1962     enum SI_ASYNCIO = _Anonymous_25.SI_ASYNCIO;
1963     enum SI_MESGQ = _Anonymous_25.SI_MESGQ;
1964     enum SI_TIMER = _Anonymous_25.SI_TIMER;
1965     enum SI_QUEUE = _Anonymous_25.SI_QUEUE;
1966     enum SI_USER = _Anonymous_25.SI_USER;
1967     enum SI_KERNEL = _Anonymous_25.SI_KERNEL;
1968     char* gcvt(double, int, char*) @nogc nothrow;
1969     char* fcvt(double, int, int*, int*) @nogc nothrow;
1970     enum _Anonymous_26
1971     {
1972         ILL_ILLOPC = 1,
1973         ILL_ILLOPN = 2,
1974         ILL_ILLADR = 3,
1975         ILL_ILLTRP = 4,
1976         ILL_PRVOPC = 5,
1977         ILL_PRVREG = 6,
1978         ILL_COPROC = 7,
1979         ILL_BADSTK = 8,
1980         ILL_BADIADDR = 9,
1981     }
1982     enum ILL_ILLOPC = _Anonymous_26.ILL_ILLOPC;
1983     enum ILL_ILLOPN = _Anonymous_26.ILL_ILLOPN;
1984     enum ILL_ILLADR = _Anonymous_26.ILL_ILLADR;
1985     enum ILL_ILLTRP = _Anonymous_26.ILL_ILLTRP;
1986     enum ILL_PRVOPC = _Anonymous_26.ILL_PRVOPC;
1987     enum ILL_PRVREG = _Anonymous_26.ILL_PRVREG;
1988     enum ILL_COPROC = _Anonymous_26.ILL_COPROC;
1989     enum ILL_BADSTK = _Anonymous_26.ILL_BADSTK;
1990     enum ILL_BADIADDR = _Anonymous_26.ILL_BADIADDR;
1991     char* ecvt(double, int, int*, int*) @nogc nothrow;
1992     lldiv_t lldiv(long, long) @nogc nothrow;
1993     enum _Anonymous_27
1994     {
1995         FPE_INTDIV = 1,
1996         FPE_INTOVF = 2,
1997         FPE_FLTDIV = 3,
1998         FPE_FLTOVF = 4,
1999         FPE_FLTUND = 5,
2000         FPE_FLTRES = 6,
2001         FPE_FLTINV = 7,
2002         FPE_FLTSUB = 8,
2003         FPE_FLTUNK = 14,
2004         FPE_CONDTRAP = 15,
2005     }
2006     enum FPE_INTDIV = _Anonymous_27.FPE_INTDIV;
2007     enum FPE_INTOVF = _Anonymous_27.FPE_INTOVF;
2008     enum FPE_FLTDIV = _Anonymous_27.FPE_FLTDIV;
2009     enum FPE_FLTOVF = _Anonymous_27.FPE_FLTOVF;
2010     enum FPE_FLTUND = _Anonymous_27.FPE_FLTUND;
2011     enum FPE_FLTRES = _Anonymous_27.FPE_FLTRES;
2012     enum FPE_FLTINV = _Anonymous_27.FPE_FLTINV;
2013     enum FPE_FLTSUB = _Anonymous_27.FPE_FLTSUB;
2014     enum FPE_FLTUNK = _Anonymous_27.FPE_FLTUNK;
2015     enum FPE_CONDTRAP = _Anonymous_27.FPE_CONDTRAP;
2016     ldiv_t ldiv(c_long, c_long) @nogc nothrow;
2017     div_t div(int, int) @nogc nothrow;
2018     long llabs(long) @nogc nothrow;
2019     enum _Anonymous_28
2020     {
2021         SEGV_MAPERR = 1,
2022         SEGV_ACCERR = 2,
2023         SEGV_BNDERR = 3,
2024         SEGV_PKUERR = 4,
2025         SEGV_ACCADI = 5,
2026         SEGV_ADIDERR = 6,
2027         SEGV_ADIPERR = 7,
2028     }
2029     enum SEGV_MAPERR = _Anonymous_28.SEGV_MAPERR;
2030     enum SEGV_ACCERR = _Anonymous_28.SEGV_ACCERR;
2031     enum SEGV_BNDERR = _Anonymous_28.SEGV_BNDERR;
2032     enum SEGV_PKUERR = _Anonymous_28.SEGV_PKUERR;
2033     enum SEGV_ACCADI = _Anonymous_28.SEGV_ACCADI;
2034     enum SEGV_ADIDERR = _Anonymous_28.SEGV_ADIDERR;
2035     enum SEGV_ADIPERR = _Anonymous_28.SEGV_ADIPERR;
2036     c_long labs(c_long) @nogc nothrow;
2037     int abs(int) @nogc nothrow;
2038     void qsort(void*, c_ulong, c_ulong, int function(const(void)*, const(void)*)) @nogc nothrow;
2039     enum _Anonymous_29
2040     {
2041         BUS_ADRALN = 1,
2042         BUS_ADRERR = 2,
2043         BUS_OBJERR = 3,
2044         BUS_MCEERR_AR = 4,
2045         BUS_MCEERR_AO = 5,
2046     }
2047     enum BUS_ADRALN = _Anonymous_29.BUS_ADRALN;
2048     enum BUS_ADRERR = _Anonymous_29.BUS_ADRERR;
2049     enum BUS_OBJERR = _Anonymous_29.BUS_OBJERR;
2050     enum BUS_MCEERR_AR = _Anonymous_29.BUS_MCEERR_AR;
2051     enum BUS_MCEERR_AO = _Anonymous_29.BUS_MCEERR_AO;
2052     void* bsearch(const(void)*, const(void)*, c_ulong, c_ulong, int function(const(void)*, const(void)*)) @nogc nothrow;
2053     alias __compar_fn_t = int function(const(void)*, const(void)*);
2054     enum _Anonymous_30
2055     {
2056         CLD_EXITED = 1,
2057         CLD_KILLED = 2,
2058         CLD_DUMPED = 3,
2059         CLD_TRAPPED = 4,
2060         CLD_STOPPED = 5,
2061         CLD_CONTINUED = 6,
2062     }
2063     enum CLD_EXITED = _Anonymous_30.CLD_EXITED;
2064     enum CLD_KILLED = _Anonymous_30.CLD_KILLED;
2065     enum CLD_DUMPED = _Anonymous_30.CLD_DUMPED;
2066     enum CLD_TRAPPED = _Anonymous_30.CLD_TRAPPED;
2067     enum CLD_STOPPED = _Anonymous_30.CLD_STOPPED;
2068     enum CLD_CONTINUED = _Anonymous_30.CLD_CONTINUED;
2069     char* realpath(const(char)*, char*) @nogc nothrow;
2070     int system(const(char)*) @nogc nothrow;
2071     enum _Anonymous_31
2072     {
2073         POLL_IN = 1,
2074         POLL_OUT = 2,
2075         POLL_MSG = 3,
2076         POLL_ERR = 4,
2077         POLL_PRI = 5,
2078         POLL_HUP = 6,
2079     }
2080     enum POLL_IN = _Anonymous_31.POLL_IN;
2081     enum POLL_OUT = _Anonymous_31.POLL_OUT;
2082     enum POLL_MSG = _Anonymous_31.POLL_MSG;
2083     enum POLL_ERR = _Anonymous_31.POLL_ERR;
2084     enum POLL_PRI = _Anonymous_31.POLL_PRI;
2085     enum POLL_HUP = _Anonymous_31.POLL_HUP;
2086     char* mkdtemp(char*) @nogc nothrow;
2087     int mkstemps(char*, int) @nogc nothrow;
2088     int mkstemp(char*) @nogc nothrow;
2089     char* mktemp(char*) @nogc nothrow;
2090     int clearenv() @nogc nothrow;
2091     int unsetenv(const(char)*) @nogc nothrow;
2092     int setenv(const(char)*, const(char)*, int) @nogc nothrow;
2093     int putenv(char*) @nogc nothrow;
2094     char* getenv(const(char)*) @nogc nothrow;
2095     void _Exit(int) @nogc nothrow;
2096     void quick_exit(int) @nogc nothrow;
2097     void exit(int) @nogc nothrow;
2098     int on_exit(void function(int, void*), void*) @nogc nothrow;
2099     int at_quick_exit(void function()) @nogc nothrow;
2100     int atexit(void function()) @nogc nothrow;
2101     void abort() @nogc nothrow;
2102     void* aligned_alloc(c_ulong, c_ulong) @nogc nothrow;
2103     int pthread_sigmask(int, const(__sigset_t)*, __sigset_t*) @nogc nothrow;
2104     int pthread_kill(c_ulong, int) @nogc nothrow;
2105     enum _Anonymous_32
2106     {
2107         SS_ONSTACK = 1,
2108         SS_DISABLE = 2,
2109     }
2110     enum SS_ONSTACK = _Anonymous_32.SS_ONSTACK;
2111     enum SS_DISABLE = _Anonymous_32.SS_DISABLE;
2112     int posix_memalign(void**, c_ulong, c_ulong) @nogc nothrow;
2113     alias int8_t = byte;
2114     void* valloc(c_ulong) @nogc nothrow;
2115     extern __gshared int sys_nerr;
2116     extern __gshared const(const(char)*)[0] sys_errlist;
2117     alias __pthread_list_t = __pthread_internal_list;
2118     struct __pthread_internal_list
2119     {
2120         @DppOffsetSize(0,8) __pthread_internal_list* __prev;
2121         @DppOffsetSize(8,8) __pthread_internal_list* __next;
2122     }
2123     void free(void*) @nogc nothrow;
2124     struct __pthread_mutex_s
2125     {
2126         @DppOffsetSize(0,4) int __lock;
2127         @DppOffsetSize(4,4) uint __count;
2128         @DppOffsetSize(8,4) int __owner;
2129         @DppOffsetSize(12,4) uint __nusers;
2130         @DppOffsetSize(16,4) int __kind;
2131         @DppOffsetSize(20,2) short __spins;
2132         @DppOffsetSize(22,2) short __elision;
2133         @DppOffsetSize(24,16) __pthread_internal_list __list;
2134     }
2135     struct __pthread_cond_s
2136     {
2137         static union _Anonymous_33
2138         {
2139             @DppOffsetSize(0,8) ulong __wseq;
2140             static struct _Anonymous_34
2141             {
2142                 @DppOffsetSize(0,4) uint __low;
2143                 @DppOffsetSize(4,4) uint __high;
2144             }
2145             @DppOffsetSize(0,8) _Anonymous_34 __wseq32;
2146         }
2147         _Anonymous_33 _anonymous_35;
2148         auto __wseq() @property @nogc pure nothrow { return _anonymous_35.__wseq; }
2149         void __wseq(_T_)(auto ref _T_ val) @property @nogc pure nothrow { _anonymous_35.__wseq = val; }
2150         auto __wseq32() @property @nogc pure nothrow { return _anonymous_35.__wseq32; }
2151         void __wseq32(_T_)(auto ref _T_ val) @property @nogc pure nothrow { _anonymous_35.__wseq32 = val; }
2152         static union _Anonymous_36
2153         {
2154             @DppOffsetSize(0,8) ulong __g1_start;
2155             static struct _Anonymous_37
2156             {
2157                 @DppOffsetSize(0,4) uint __low;
2158                 @DppOffsetSize(4,4) uint __high;
2159             }
2160             @DppOffsetSize(0,8) _Anonymous_37 __g1_start32;
2161         }
2162         _Anonymous_36 _anonymous_38;
2163         auto __g1_start() @property @nogc pure nothrow { return _anonymous_38.__g1_start; }
2164         void __g1_start(_T_)(auto ref _T_ val) @property @nogc pure nothrow { _anonymous_38.__g1_start = val; }
2165         auto __g1_start32() @property @nogc pure nothrow { return _anonymous_38.__g1_start32; }
2166         void __g1_start32(_T_)(auto ref _T_ val) @property @nogc pure nothrow { _anonymous_38.__g1_start32 = val; }
2167         @DppOffsetSize(16,8) uint[2] __g_refs;
2168         @DppOffsetSize(24,8) uint[2] __g_size;
2169         @DppOffsetSize(32,4) uint __g1_orig_size;
2170         @DppOffsetSize(36,4) uint __wrefs;
2171         @DppOffsetSize(40,8) uint[2] __g_signals;
2172     }
2173     void* reallocarray(void*, c_ulong, c_ulong) @nogc nothrow;
2174     alias __u_char = ubyte;
2175     alias __u_short = ushort;
2176     alias __u_int = uint;
2177     alias __u_long = c_ulong;
2178     alias __int8_t = byte;
2179     alias __uint8_t = ubyte;
2180     alias __int16_t = short;
2181     alias __uint16_t = ushort;
2182     alias __int32_t = int;
2183     alias __uint32_t = uint;
2184     alias __int64_t = c_long;
2185     alias __uint64_t = c_ulong;
2186     alias __int_least8_t = byte;
2187     alias __uint_least8_t = ubyte;
2188     alias __int_least16_t = short;
2189     alias __uint_least16_t = ushort;
2190     alias __int_least32_t = int;
2191     alias __uint_least32_t = uint;
2192     alias __int_least64_t = c_long;
2193     alias __uint_least64_t = c_ulong;
2194     alias __quad_t = c_long;
2195     alias __u_quad_t = c_ulong;
2196     alias __intmax_t = c_long;
2197     alias __uintmax_t = c_ulong;
2198     void* realloc(void*, c_ulong) @nogc nothrow;
2199     void* calloc(c_ulong, c_ulong) @nogc nothrow;
2200     void* malloc(c_ulong) @nogc nothrow;
2201     int lcong48_r(ushort*, drand48_data*) @nogc nothrow;
2202     alias __dev_t = c_ulong;
2203     alias __uid_t = uint;
2204     alias __gid_t = uint;
2205     alias __ino_t = c_ulong;
2206     alias __ino64_t = c_ulong;
2207     alias __mode_t = uint;
2208     alias __nlink_t = c_ulong;
2209     alias __off_t = c_long;
2210     alias __off64_t = c_long;
2211     alias __pid_t = int;
2212     struct __fsid_t
2213     {
2214         @DppOffsetSize(0,8) int[2] __val;
2215     }
2216     alias __clock_t = c_long;
2217     alias __rlim_t = c_ulong;
2218     alias __rlim64_t = c_ulong;
2219     alias __id_t = uint;
2220     alias __time_t = c_long;
2221     alias __useconds_t = uint;
2222     alias __suseconds_t = c_long;
2223     alias __daddr_t = int;
2224     alias __key_t = int;
2225     alias __clockid_t = int;
2226     alias __timer_t = void*;
2227     alias __blksize_t = c_long;
2228     alias __blkcnt_t = c_long;
2229     alias __blkcnt64_t = c_long;
2230     alias __fsblkcnt_t = c_ulong;
2231     alias __fsblkcnt64_t = c_ulong;
2232     alias __fsfilcnt_t = c_ulong;
2233     alias __fsfilcnt64_t = c_ulong;
2234     alias __fsword_t = c_long;
2235     alias __ssize_t = c_long;
2236     alias __syscall_slong_t = c_long;
2237     alias __syscall_ulong_t = c_ulong;
2238     alias __loff_t = c_long;
2239     alias __caddr_t = char*;
2240     alias __intptr_t = c_long;
2241     alias __socklen_t = uint;
2242     alias __sig_atomic_t = int;
2243     int seed48_r(ushort*, drand48_data*) @nogc nothrow;
2244     alias FILE = _IO_FILE;
2245     struct _IO_FILE
2246     {
2247         @DppOffsetSize(0,4) int _flags;
2248         @DppOffsetSize(8,8) char* _IO_read_ptr;
2249         @DppOffsetSize(16,8) char* _IO_read_end;
2250         @DppOffsetSize(24,8) char* _IO_read_base;
2251         @DppOffsetSize(32,8) char* _IO_write_base;
2252         @DppOffsetSize(40,8) char* _IO_write_ptr;
2253         @DppOffsetSize(48,8) char* _IO_write_end;
2254         @DppOffsetSize(56,8) char* _IO_buf_base;
2255         @DppOffsetSize(64,8) char* _IO_buf_end;
2256         @DppOffsetSize(72,8) char* _IO_save_base;
2257         @DppOffsetSize(80,8) char* _IO_backup_base;
2258         @DppOffsetSize(88,8) char* _IO_save_end;
2259         @DppOffsetSize(96,8) _IO_marker* _markers;
2260         @DppOffsetSize(104,8) _IO_FILE* _chain;
2261         @DppOffsetSize(112,4) int _fileno;
2262         @DppOffsetSize(116,4) int _flags2;
2263         @DppOffsetSize(120,8) c_long _old_offset;
2264         @DppOffsetSize(128,2) ushort _cur_column;
2265         @DppOffsetSize(130,1) byte _vtable_offset;
2266         @DppOffsetSize(131,1) char[1] _shortbuf;
2267         @DppOffsetSize(136,8) void* _lock;
2268         @DppOffsetSize(144,8) c_long _offset;
2269         @DppOffsetSize(152,8) _IO_codecvt* _codecvt;
2270         @DppOffsetSize(160,8) _IO_wide_data* _wide_data;
2271         @DppOffsetSize(168,8) _IO_FILE* _freeres_list;
2272         @DppOffsetSize(176,8) void* _freeres_buf;
2273         @DppOffsetSize(184,8) c_ulong __pad5;
2274         @DppOffsetSize(192,4) int _mode;
2275         @DppOffsetSize(196,20) char[20] _unused2;
2276     }
2277     alias __FILE = _IO_FILE;
2278     int srand48_r(c_long, drand48_data*) @nogc nothrow;
2279     alias __fpos64_t = _G_fpos64_t;
2280     struct _G_fpos64_t
2281     {
2282         @DppOffsetSize(0,8) c_long __pos;
2283         @DppOffsetSize(8,8) __mbstate_t __state;
2284     }
2285     alias __fpos_t = _G_fpos_t;
2286     struct _G_fpos_t
2287     {
2288         @DppOffsetSize(0,8) c_long __pos;
2289         @DppOffsetSize(8,8) __mbstate_t __state;
2290     }
2291     struct __mbstate_t
2292     {
2293         @DppOffsetSize(0,4) int __count;
2294         static union _Anonymous_39
2295         {
2296             @DppOffsetSize(0,4) uint __wch;
2297             @DppOffsetSize(0,4) char[4] __wchb;
2298         }
2299         @DppOffsetSize(4,4) _Anonymous_39 __value;
2300     }
2301     int jrand48_r(ushort*, drand48_data*, c_long*) @nogc nothrow;
2302     struct __sigset_t
2303     {
2304         @DppOffsetSize(0,128) c_ulong[16] __val;
2305     }
2306     union sigval
2307     {
2308         @DppOffsetSize(0,4) int sival_int;
2309         @DppOffsetSize(0,8) void* sival_ptr;
2310     }
2311     alias __sigval_t = sigval;
2312     int mrand48_r(drand48_data*, c_long*) @nogc nothrow;
2313     alias clock_t = c_long;
2314     alias clockid_t = int;
2315     alias sig_atomic_t = int;
2316     int nrand48_r(ushort*, drand48_data*, c_long*) @nogc nothrow;
2317     alias sigevent_t = sigevent;
2318     struct sigevent
2319     {
2320         @DppOffsetSize(0,8) sigval sigev_value;
2321         @DppOffsetSize(8,4) int sigev_signo;
2322         @DppOffsetSize(12,4) int sigev_notify;
2323         static union _Anonymous_40
2324         {
2325             @DppOffsetSize(0,48) int[12] _pad;
2326             @DppOffsetSize(0,4) int _tid;
2327             static struct _Anonymous_41
2328             {
2329                 @DppOffsetSize(0,8) void function(sigval) _function;
2330                 @DppOffsetSize(8,8) pthread_attr_t* _attribute;
2331             }
2332             @DppOffsetSize(0,16) _Anonymous_41 _sigev_thread;
2333         }
2334         @DppOffsetSize(16,48) _Anonymous_40 _sigev_un;
2335     }
2336     int lrand48_r(drand48_data*, c_long*) @nogc nothrow;
2337     int erand48_r(ushort*, drand48_data*, double*) @nogc nothrow;
2338     int drand48_r(drand48_data*, double*) @nogc nothrow;
2339     struct drand48_data
2340     {
2341         @DppOffsetSize(0,6) ushort[3] __x;
2342         @DppOffsetSize(6,6) ushort[3] __old_x;
2343         @DppOffsetSize(12,2) ushort __c;
2344         @DppOffsetSize(14,2) ushort __init;
2345         @DppOffsetSize(16,8) ulong __a;
2346     }
2347     struct siginfo_t
2348     {
2349         @DppOffsetSize(0,4) int si_signo;
2350         @DppOffsetSize(4,4) int si_errno;
2351         @DppOffsetSize(8,4) int si_code;
2352         @DppOffsetSize(12,4) int __pad0;
2353         static union _Anonymous_42
2354         {
2355             @DppOffsetSize(0,112) int[28] _pad;
2356             static struct _Anonymous_43
2357             {
2358                 @DppOffsetSize(0,4) int si_pid;
2359                 @DppOffsetSize(4,4) uint si_uid;
2360             }
2361             @DppOffsetSize(0,8) _Anonymous_43 _kill;
2362             static struct _Anonymous_44
2363             {
2364                 @DppOffsetSize(0,4) int si_tid;
2365                 @DppOffsetSize(4,4) int si_overrun;
2366                 @DppOffsetSize(8,8) sigval si_sigval;
2367             }
2368             @DppOffsetSize(0,16) _Anonymous_44 _timer;
2369             static struct _Anonymous_45
2370             {
2371                 @DppOffsetSize(0,4) int si_pid;
2372                 @DppOffsetSize(4,4) uint si_uid;
2373                 @DppOffsetSize(8,8) sigval si_sigval;
2374             }
2375             @DppOffsetSize(0,16) _Anonymous_45 _rt;
2376             static struct _Anonymous_46
2377             {
2378                 @DppOffsetSize(0,4) int si_pid;
2379                 @DppOffsetSize(4,4) uint si_uid;
2380                 @DppOffsetSize(8,4) int si_status;
2381                 @DppOffsetSize(16,8) c_long si_utime;
2382                 @DppOffsetSize(24,8) c_long si_stime;
2383             }
2384             @DppOffsetSize(0,32) _Anonymous_46 _sigchld;
2385             static struct _Anonymous_47
2386             {
2387                 @DppOffsetSize(0,8) void* si_addr;
2388                 @DppOffsetSize(8,2) short si_addr_lsb;
2389                 static union _Anonymous_48
2390                 {
2391                     static struct _Anonymous_49
2392                     {
2393                         @DppOffsetSize(0,8) void* _lower;
2394                         @DppOffsetSize(8,8) void* _upper;
2395                     }
2396                     @DppOffsetSize(0,16) _Anonymous_49 _addr_bnd;
2397                     @DppOffsetSize(0,4) uint _pkey;
2398                 }
2399                 @DppOffsetSize(16,16) _Anonymous_48 _bounds;
2400             }
2401             @DppOffsetSize(0,32) _Anonymous_47 _sigfault;
2402             static struct _Anonymous_50
2403             {
2404                 @DppOffsetSize(0,8) c_long si_band;
2405                 @DppOffsetSize(8,4) int si_fd;
2406             }
2407             @DppOffsetSize(0,16) _Anonymous_50 _sigpoll;
2408             static struct _Anonymous_51
2409             {
2410                 @DppOffsetSize(0,8) void* _call_addr;
2411                 @DppOffsetSize(8,4) int _syscall;
2412                 @DppOffsetSize(12,4) uint _arch;
2413             }
2414             @DppOffsetSize(0,16) _Anonymous_51 _sigsys;
2415         }
2416         @DppOffsetSize(16,112) _Anonymous_42 _sifields;
2417     }
2418     void lcong48(ushort*) @nogc nothrow;
2419     ushort* seed48(ushort*) @nogc nothrow;
2420     void srand48(c_long) @nogc nothrow;
2421     c_long jrand48(ushort*) @nogc nothrow;
2422     c_long mrand48() @nogc nothrow;
2423     c_long nrand48(ushort*) @nogc nothrow;
2424     c_long lrand48() @nogc nothrow;
2425     double erand48(ushort*) @nogc nothrow;
2426     double drand48() @nogc nothrow;
2427     alias sigset_t = __sigset_t;
2428     alias sigval_t = sigval;
2429     int rand_r(uint*) @nogc nothrow;
2430     struct stack_t
2431     {
2432         @DppOffsetSize(0,8) void* ss_sp;
2433         @DppOffsetSize(8,4) int ss_flags;
2434         @DppOffsetSize(16,8) c_ulong ss_size;
2435     }
2436     struct _IO_marker;
2437     struct _IO_codecvt;
2438     struct _IO_wide_data;
2439     alias _IO_lock_t = void;
2440     void srand(uint) @nogc nothrow;
2441     int rand() @nogc nothrow;
2442     int setstate_r(char*, random_data*) @nogc nothrow;
2443     struct sigstack
2444     {
2445         @DppOffsetSize(0,8) void* ss_sp;
2446         @DppOffsetSize(8,4) int ss_onstack;
2447     }
2448     struct timespec
2449     {
2450         @DppOffsetSize(0,8) c_long tv_sec;
2451         @DppOffsetSize(8,8) c_long tv_nsec;
2452     }
2453     int initstate_r(uint, char*, c_ulong, random_data*) @nogc nothrow;
2454     struct timeval
2455     {
2456         @DppOffsetSize(0,8) c_long tv_sec;
2457         @DppOffsetSize(8,8) c_long tv_usec;
2458     }
2459     alias time_t = c_long;
2460     alias timer_t = void*;
2461     int srandom_r(uint, random_data*) @nogc nothrow;
2462     int random_r(random_data*, int*) @nogc nothrow;
2463     struct random_data
2464     {
2465         @DppOffsetSize(0,8) int* fptr;
2466         @DppOffsetSize(8,8) int* rptr;
2467         @DppOffsetSize(16,8) int* state;
2468         @DppOffsetSize(24,4) int rand_type;
2469         @DppOffsetSize(28,4) int rand_deg;
2470         @DppOffsetSize(32,4) int rand_sep;
2471         @DppOffsetSize(40,8) int* end_ptr;
2472     }
2473     char* setstate(char*) @nogc nothrow;
2474     char* initstate(uint, char*, c_ulong) @nogc nothrow;
2475     void srandom(uint) @nogc nothrow;
2476     c_long random() @nogc nothrow;
2477     c_long a64l(const(char)*) @nogc nothrow;
2478     char* l64a(c_long) @nogc nothrow;
2479     ulong strtoull(const(char)*, char**, int) @nogc nothrow;
2480     long strtoll(const(char)*, char**, int) @nogc nothrow;
2481     ulong strtouq(const(char)*, char**, int) @nogc nothrow;
2482     long strtoq(const(char)*, char**, int) @nogc nothrow;
2483     c_ulong strtoul(const(char)*, char**, int) @nogc nothrow;
2484     c_long strtol(const(char)*, char**, int) @nogc nothrow;
2485     real strtold(const(char)*, char**) @nogc nothrow;
2486     float strtof(const(char)*, char**) @nogc nothrow;
2487     double strtod(const(char)*, char**) @nogc nothrow;
2488     long atoll(const(char)*) @nogc nothrow;
2489     c_long atol(const(char)*) @nogc nothrow;
2490     int atoi(const(char)*) @nogc nothrow;
2491     int* __errno_location() @nogc nothrow;
2492     double atof(const(char)*) @nogc nothrow;
2493     c_ulong __ctype_get_mb_cur_max() @nogc nothrow;
2494     struct lldiv_t
2495     {
2496         @DppOffsetSize(0,8) long quot;
2497         @DppOffsetSize(8,8) long rem;
2498     }
2499     struct ldiv_t
2500     {
2501         @DppOffsetSize(0,8) c_long quot;
2502         @DppOffsetSize(8,8) c_long rem;
2503     }
2504     struct div_t
2505     {
2506         @DppOffsetSize(0,4) int quot;
2507         @DppOffsetSize(4,4) int rem;
2508     }
2509     int __overflow(_IO_FILE*, int) @nogc nothrow;
2510     int __uflow(_IO_FILE*) @nogc nothrow;
2511     void funlockfile(_IO_FILE*) @nogc nothrow;
2512     int ftrylockfile(_IO_FILE*) @nogc nothrow;
2513     void flockfile(_IO_FILE*) @nogc nothrow;
2514     char* ctermid(char*) @nogc nothrow;
2515     int pclose(_IO_FILE*) @nogc nothrow;
2516     _IO_FILE* popen(const(char)*, const(char)*) @nogc nothrow;
2517     int fileno_unlocked(_IO_FILE*) @nogc nothrow;
2518     int fileno(_IO_FILE*) @nogc nothrow;
2519     void perror(const(char)*) @nogc nothrow;
2520     int ferror_unlocked(_IO_FILE*) @nogc nothrow;
2521     int feof_unlocked(_IO_FILE*) @nogc nothrow;
2522     void clearerr_unlocked(_IO_FILE*) @nogc nothrow;
2523     int ferror(_IO_FILE*) @nogc nothrow;
2524     int feof(_IO_FILE*) @nogc nothrow;
2525     alias __re_size_t = uint;
2526     alias __re_long_size_t = c_ulong;
2527     alias s_reg_t = c_long;
2528     alias active_reg_t = c_ulong;
2529     alias reg_syntax_t = c_ulong;
2530     extern __gshared c_ulong re_syntax_options;
2531     void clearerr(_IO_FILE*) @nogc nothrow;
2532     int fsetpos(_IO_FILE*, const(_G_fpos_t)*) @nogc nothrow;
2533     int fgetpos(_IO_FILE*, _G_fpos_t*) @nogc nothrow;
2534     c_long ftello(_IO_FILE*) @nogc nothrow;
2535     int fseeko(_IO_FILE*, c_long, int) @nogc nothrow;
2536     alias reg_errcode_t = _Anonymous_52;
2537     enum _Anonymous_52
2538     {
2539         _REG_ENOSYS = -1,
2540         _REG_NOERROR = 0,
2541         _REG_NOMATCH = 1,
2542         _REG_BADPAT = 2,
2543         _REG_ECOLLATE = 3,
2544         _REG_ECTYPE = 4,
2545         _REG_EESCAPE = 5,
2546         _REG_ESUBREG = 6,
2547         _REG_EBRACK = 7,
2548         _REG_EPAREN = 8,
2549         _REG_EBRACE = 9,
2550         _REG_BADBR = 10,
2551         _REG_ERANGE = 11,
2552         _REG_ESPACE = 12,
2553         _REG_BADRPT = 13,
2554         _REG_EEND = 14,
2555         _REG_ESIZE = 15,
2556         _REG_ERPAREN = 16,
2557     }
2558     enum _REG_ENOSYS = _Anonymous_52._REG_ENOSYS;
2559     enum _REG_NOERROR = _Anonymous_52._REG_NOERROR;
2560     enum _REG_NOMATCH = _Anonymous_52._REG_NOMATCH;
2561     enum _REG_BADPAT = _Anonymous_52._REG_BADPAT;
2562     enum _REG_ECOLLATE = _Anonymous_52._REG_ECOLLATE;
2563     enum _REG_ECTYPE = _Anonymous_52._REG_ECTYPE;
2564     enum _REG_EESCAPE = _Anonymous_52._REG_EESCAPE;
2565     enum _REG_ESUBREG = _Anonymous_52._REG_ESUBREG;
2566     enum _REG_EBRACK = _Anonymous_52._REG_EBRACK;
2567     enum _REG_EPAREN = _Anonymous_52._REG_EPAREN;
2568     enum _REG_EBRACE = _Anonymous_52._REG_EBRACE;
2569     enum _REG_BADBR = _Anonymous_52._REG_BADBR;
2570     enum _REG_ERANGE = _Anonymous_52._REG_ERANGE;
2571     enum _REG_ESPACE = _Anonymous_52._REG_ESPACE;
2572     enum _REG_BADRPT = _Anonymous_52._REG_BADRPT;
2573     enum _REG_EEND = _Anonymous_52._REG_EEND;
2574     enum _REG_ESIZE = _Anonymous_52._REG_ESIZE;
2575     enum _REG_ERPAREN = _Anonymous_52._REG_ERPAREN;
2576     void rewind(_IO_FILE*) @nogc nothrow;
2577     c_long ftell(_IO_FILE*) @nogc nothrow;
2578     int fseek(_IO_FILE*, c_long, int) @nogc nothrow;
2579     c_ulong fwrite_unlocked(const(void)*, c_ulong, c_ulong, _IO_FILE*) @nogc nothrow;
2580     c_ulong fread_unlocked(void*, c_ulong, c_ulong, _IO_FILE*) @nogc nothrow;
2581     c_ulong fwrite(const(void)*, c_ulong, c_ulong, _IO_FILE*) @nogc nothrow;
2582     c_ulong fread(void*, c_ulong, c_ulong, _IO_FILE*) @nogc nothrow;
2583     int ungetc(int, _IO_FILE*) @nogc nothrow;
2584     int puts(const(char)*) @nogc nothrow;
2585     int fputs(const(char)*, _IO_FILE*) @nogc nothrow;
2586     c_long getline(char**, c_ulong*, _IO_FILE*) @nogc nothrow;
2587     c_long getdelim(char**, c_ulong*, int, _IO_FILE*) @nogc nothrow;
2588     struct re_pattern_buffer
2589     {
2590         import std.bitmanip: bitfields;
2591 
2592         align(4):
2593         @DppOffsetSize(0,8) re_dfa_t* __buffer;
2594         @DppOffsetSize(8,8) c_ulong __allocated;
2595         @DppOffsetSize(16,8) c_ulong __used;
2596         @DppOffsetSize(24,8) c_ulong __syntax;
2597         @DppOffsetSize(32,8) char* __fastmap;
2598         @DppOffsetSize(40,8) ubyte* __translate;
2599         @DppOffsetSize(48,8) c_ulong re_nsub;
2600         mixin(bitfields!(
2601             uint, "__can_be_null", 1,
2602             uint, "__regs_allocated", 2,
2603             uint, "__fastmap_accurate", 1,
2604             uint, "__no_sub", 1,
2605             uint, "__not_bol", 1,
2606             uint, "__not_eol", 1,
2607             uint, "__newline_anchor", 1,
2608         ));
2609     }
2610     alias regex_t = re_pattern_buffer;
2611     alias regoff_t = int;
2612     struct regmatch_t
2613     {
2614         @DppOffsetSize(0,4) int rm_so;
2615         @DppOffsetSize(4,4) int rm_eo;
2616     }
2617     c_long __getdelim(char**, c_ulong*, int, _IO_FILE*) @nogc nothrow;
2618     int regcomp(re_pattern_buffer*, const(char)*, int) @nogc nothrow;
2619     int regexec(const(re_pattern_buffer)*, const(char)*, c_ulong, regmatch_t*, int) @nogc nothrow;
2620     c_ulong regerror(int, const(re_pattern_buffer)*, char*, c_ulong) @nogc nothrow;
2621     void regfree(re_pattern_buffer*) @nogc nothrow;
2622     alias __sighandler_t = void function(int);
2623     void function(int) __sysv_signal(int, void function(int)) @nogc nothrow;
2624     void function(int) signal(int, void function(int)) @nogc nothrow;
2625     int kill(int, int) @nogc nothrow;
2626     int killpg(int, int) @nogc nothrow;
2627     int raise(int) @nogc nothrow;
2628     void function(int) ssignal(int, void function(int)) @nogc nothrow;
2629     int gsignal(int) @nogc nothrow;
2630     void psignal(int, const(char)*) @nogc nothrow;
2631     void psiginfo(const(siginfo_t)*, const(char)*) @nogc nothrow;
2632     int sigblock(int) @nogc nothrow;
2633     int sigsetmask(int) @nogc nothrow;
2634     int siggetmask() @nogc nothrow;
2635     alias sig_t = void function();
2636     int sigemptyset(__sigset_t*) @nogc nothrow;
2637     int sigfillset(__sigset_t*) @nogc nothrow;
2638     int sigaddset(__sigset_t*, int) @nogc nothrow;
2639     int sigdelset(__sigset_t*, int) @nogc nothrow;
2640     int sigismember(const(__sigset_t)*, int) @nogc nothrow;
2641     int sigprocmask(int, const(__sigset_t)*, __sigset_t*) @nogc nothrow;
2642     int sigsuspend(const(__sigset_t)*) @nogc nothrow;
2643     pragma(mangle, "sigaction") int sigaction_(int, const(sigaction)*, sigaction*) @nogc nothrow;
2644     int sigpending(__sigset_t*) @nogc nothrow;
2645     int sigwait(const(__sigset_t)*, int*) @nogc nothrow;
2646     int sigwaitinfo(const(__sigset_t)*, siginfo_t*) @nogc nothrow;
2647     int sigtimedwait(const(__sigset_t)*, siginfo_t*, const(timespec)*) @nogc nothrow;
2648     int sigqueue(int, int, const(sigval)) @nogc nothrow;
2649     extern __gshared const(const(char)*)[65] _sys_siglist;
2650     extern __gshared const(const(char)*)[65] sys_siglist;
2651     int sigreturn(sigcontext*) @nogc nothrow;
2652     char* fgets(char*, int, _IO_FILE*) @nogc nothrow;
2653     int siginterrupt(int, int) @nogc nothrow;
2654     int sigaltstack(const(stack_t)*, stack_t*) @nogc nothrow;
2655     pragma(mangle, "sigstack") int sigstack_(sigstack*, sigstack*) @nogc nothrow;
2656     int __libc_current_sigrtmin() @nogc nothrow;
2657     int __libc_current_sigrtmax() @nogc nothrow;
2658     int putw(int, _IO_FILE*) @nogc nothrow;
2659     int getw(_IO_FILE*) @nogc nothrow;
2660     int putchar_unlocked(int) @nogc nothrow;
2661     int putc_unlocked(int, _IO_FILE*) @nogc nothrow;
2662     int fputc_unlocked(int, _IO_FILE*) @nogc nothrow;
2663     int putchar(int) @nogc nothrow;
2664     int putc(int, _IO_FILE*) @nogc nothrow;
2665     int fputc(int, _IO_FILE*) @nogc nothrow;
2666     alias fpos_t = _G_fpos_t;
2667     int fgetc_unlocked(_IO_FILE*) @nogc nothrow;
2668     int getchar_unlocked() @nogc nothrow;
2669     int getc_unlocked(_IO_FILE*) @nogc nothrow;
2670     int getchar() @nogc nothrow;
2671     int getc(_IO_FILE*) @nogc nothrow;
2672     int fgetc(_IO_FILE*) @nogc nothrow;
2673     extern __gshared _IO_FILE* stdin;
2674     extern __gshared _IO_FILE* stdout;
2675     extern __gshared _IO_FILE* stderr;
2676     int remove(const(char)*) @nogc nothrow;
2677     int rename(const(char)*, const(char)*) @nogc nothrow;
2678     int renameat(int, const(char)*, int, const(char)*) @nogc nothrow;
2679     _IO_FILE* tmpfile() @nogc nothrow;
2680     char* tmpnam(char*) @nogc nothrow;
2681     char* tmpnam_r(char*) @nogc nothrow;
2682     char* tempnam(const(char)*, const(char)*) @nogc nothrow;
2683     int fclose(_IO_FILE*) @nogc nothrow;
2684     int fflush(_IO_FILE*) @nogc nothrow;
2685     int fflush_unlocked(_IO_FILE*) @nogc nothrow;
2686     _IO_FILE* fopen(const(char)*, const(char)*) @nogc nothrow;
2687     _IO_FILE* freopen(const(char)*, const(char)*, _IO_FILE*) @nogc nothrow;
2688     _IO_FILE* fdopen(int, const(char)*) @nogc nothrow;
2689     _IO_FILE* fmemopen(void*, c_ulong, const(char)*) @nogc nothrow;
2690     _IO_FILE* open_memstream(char**, c_ulong*) @nogc nothrow;
2691     void setbuf(_IO_FILE*, char*) @nogc nothrow;
2692     int setvbuf(_IO_FILE*, char*, int, c_ulong) @nogc nothrow;
2693     void setbuffer(_IO_FILE*, char*, c_ulong) @nogc nothrow;
2694     void setlinebuf(_IO_FILE*) @nogc nothrow;
2695     int fprintf(_IO_FILE*, const(char)*, ...) @nogc nothrow;
2696     int printf(const(char)*, ...) @nogc nothrow;
2697     int sprintf(char*, const(char)*, ...) @nogc nothrow;
2698     int vfprintf(_IO_FILE*, const(char)*, va_list*) @nogc nothrow;
2699     int vprintf(const(char)*, va_list*) @nogc nothrow;
2700     int vsprintf(char*, const(char)*, va_list*) @nogc nothrow;
2701     int snprintf(char*, c_ulong, const(char)*, ...) @nogc nothrow;
2702     int vsnprintf(char*, c_ulong, const(char)*, va_list*) @nogc nothrow;
2703     int vdprintf(int, const(char)*, va_list*) @nogc nothrow;
2704     int dprintf(int, const(char)*, ...) @nogc nothrow;
2705     int fscanf(_IO_FILE*, const(char)*, ...) @nogc nothrow;
2706     int scanf(const(char)*, ...) @nogc nothrow;
2707     int sscanf(const(char)*, const(char)*, ...) @nogc nothrow;
2708     int vfscanf(_IO_FILE*, const(char)*, va_list*) @nogc nothrow;
2709     int vscanf(const(char)*, va_list*) @nogc nothrow;
2710     int vsscanf(const(char)*, const(char)*, va_list*) @nogc nothrow;
2711     enum DPP_ENUM_SEEK_END = 2;
2712 
2713 
2714     enum DPP_ENUM_SEEK_CUR = 1;
2715 
2716 
2717     enum DPP_ENUM_SEEK_SET = 0;
2718 
2719 
2720 
2721 
2722     enum DPP_ENUM_BUFSIZ = 8192;
2723 
2724 
2725     enum DPP_ENUM__IONBF = 2;
2726 
2727 
2728     enum DPP_ENUM__IOLBF = 1;
2729 
2730 
2731     enum DPP_ENUM__IOFBF = 0;
2732     enum DPP_ENUM__STDIO_H = 1;
2733 
2734 
2735     enum DPP_ENUM__STDC_PREDEF_H = 1;
2736     enum DPP_ENUM_REG_NOTBOL = 1;
2737     enum DPP_ENUM_REG_EXTENDED = 1;
2738 
2739 
2740     enum DPP_ENUM__REGEX_H = 1;
2741 
2742 
2743 
2744 
2745     enum DPP_ENUM_RTSIG_MAX = 32;
2746 
2747 
2748     enum DPP_ENUM_XATTR_LIST_MAX = 65536;
2749 
2750 
2751     enum DPP_ENUM_XATTR_SIZE_MAX = 65536;
2752 
2753 
2754     enum DPP_ENUM_XATTR_NAME_MAX = 255;
2755 
2756 
2757     enum DPP_ENUM_PIPE_BUF = 4096;
2758 
2759 
2760     enum DPP_ENUM_PATH_MAX = 4096;
2761 
2762 
2763     enum DPP_ENUM_NAME_MAX = 255;
2764 
2765 
2766     enum DPP_ENUM_MAX_INPUT = 255;
2767 
2768 
2769     enum DPP_ENUM_MAX_CANON = 255;
2770 
2771 
2772     enum DPP_ENUM_LINK_MAX = 127;
2773 
2774 
2775     enum DPP_ENUM_ARG_MAX = 131072;
2776 
2777 
2778     enum DPP_ENUM_NGROUPS_MAX = 65536;
2779 
2780 
2781     enum DPP_ENUM_NR_OPEN = 1024;
2782     enum DPP_ENUM_MB_LEN_MAX = 16;
2783 
2784 
2785     enum DPP_ENUM__LIBC_LIMITS_H_ = 1;
2786     enum DPP_ENUM___GLIBC_MINOR__ = 29;
2787 
2788 
2789     enum DPP_ENUM___GLIBC__ = 2;
2790 
2791 
2792     enum DPP_ENUM___GNU_LIBRARY__ = 6;
2793 
2794 
2795     enum DPP_ENUM___GLIBC_USE_DEPRECATED_SCANF = 0;
2796 
2797 
2798     enum DPP_ENUM___GLIBC_USE_DEPRECATED_GETS = 0;
2799 
2800 
2801     enum DPP_ENUM___USE_FORTIFY_LEVEL = 0;
2802 
2803 
2804     enum DPP_ENUM___USE_ATFILE = 1;
2805 
2806 
2807     enum DPP_ENUM___USE_MISC = 1;
2808 
2809 
2810     enum DPP_ENUM__ATFILE_SOURCE = 1;
2811 
2812 
2813     enum DPP_ENUM___USE_XOPEN2K8 = 1;
2814 
2815 
2816     enum DPP_ENUM___USE_ISOC99 = 1;
2817 
2818 
2819 
2820 
2821     enum DPP_ENUM___USE_ISOC95 = 1;
2822 
2823 
2824     enum DPP_ENUM___USE_XOPEN2K = 1;
2825 
2826 
2827     enum DPP_ENUM__STDLIB_H = 1;
2828 
2829 
2830     enum DPP_ENUM___USE_POSIX199506 = 1;
2831 
2832 
2833     enum DPP_ENUM___USE_POSIX199309 = 1;
2834 
2835 
2836     enum DPP_ENUM___USE_POSIX2 = 1;
2837     enum DPP_ENUM___USE_POSIX = 1;
2838 
2839 
2840 
2841 
2842 
2843 
2844     enum DPP_ENUM__POSIX_SOURCE = 1;
2845 
2846 
2847     enum DPP_ENUM___USE_POSIX_IMPLICITLY = 1;
2848 
2849 
2850     enum DPP_ENUM___ldiv_t_defined = 1;
2851 
2852 
2853     enum DPP_ENUM___USE_ISOC11 = 1;
2854 
2855 
2856     enum DPP_ENUM__DEFAULT_SOURCE = 1;
2857 
2858 
2859 
2860 
2861     enum DPP_ENUM___lldiv_t_defined = 1;
2862 
2863 
2864     enum DPP_ENUM_RAND_MAX = 2147483647;
2865 
2866 
2867     enum DPP_ENUM_EXIT_FAILURE = 1;
2868 
2869 
2870     enum DPP_ENUM_EXIT_SUCCESS = 0;
2871     enum DPP_ENUM__FEATURES_H = 1;
2872 
2873 
2874 
2875 
2876     enum DPP_ENUM__ERRNO_H = 1;
2877     enum DPP_ENUM___PDP_ENDIAN = 3412;
2878 
2879 
2880     enum DPP_ENUM___BIG_ENDIAN = 4321;
2881 
2882 
2883     enum DPP_ENUM___LITTLE_ENDIAN = 1234;
2884 
2885 
2886     enum DPP_ENUM__ENDIAN_H = 1;
2887 
2888 
2889     enum DPP_ENUM___SYSCALL_WORDSIZE = 64;
2890 
2891 
2892     enum DPP_ENUM___WORDSIZE_TIME64_COMPAT32 = 1;
2893 
2894 
2895     enum DPP_ENUM___WORDSIZE = 64;
2896     enum DPP_ENUM_WCONTINUED = 8;
2897 
2898 
2899     enum DPP_ENUM_WEXITED = 4;
2900 
2901 
2902     enum DPP_ENUM_WSTOPPED = 2;
2903 
2904 
2905     enum DPP_ENUM_WUNTRACED = 2;
2906 
2907 
2908     enum DPP_ENUM_WNOHANG = 1;
2909 
2910 
2911     enum DPP_ENUM__BITS_UINTN_IDENTITY_H = 1;
2912 
2913 
2914     enum DPP_ENUM___FD_SETSIZE = 1024;
2915 
2916 
2917     enum DPP_ENUM___RLIM_T_MATCHES_RLIM64_T = 1;
2918 
2919 
2920     enum DPP_ENUM___INO_T_MATCHES_INO64_T = 1;
2921 
2922 
2923     enum DPP_ENUM___OFF_T_MATCHES_OFF64_T = 1;
2924     enum DPP_ENUM__BITS_TYPESIZES_H = 1;
2925 
2926 
2927     enum DPP_ENUM___timer_t_defined = 1;
2928 
2929 
2930     enum DPP_ENUM___time_t_defined = 1;
2931 
2932 
2933     enum DPP_ENUM___timeval_defined = 1;
2934 
2935 
2936     enum DPP_ENUM__STRUCT_TIMESPEC = 1;
2937 
2938 
2939     enum DPP_ENUM___sigstack_defined = 1;
2940     enum DPP_ENUM___struct_FILE_defined = 1;
2941 
2942 
2943     enum DPP_ENUM___stack_t_defined = 1;
2944 
2945 
2946 
2947 
2948     enum DPP_ENUM___sigset_t_defined = 1;
2949     enum DPP_ENUM___SI_HAVE_SIGSYS = 1;
2950 
2951 
2952     enum DPP_ENUM___SI_ERRNO_THEN_CODE = 1;
2953     enum DPP_ENUM___SI_MAX_SIZE = 128;
2954 
2955 
2956     enum DPP_ENUM___siginfo_t_defined = 1;
2957     enum DPP_ENUM___SIGEV_MAX_SIZE = 64;
2958 
2959 
2960     enum DPP_ENUM___sigevent_t_defined = 1;
2961 
2962 
2963     enum DPP_ENUM___sig_atomic_t_defined = 1;
2964 
2965 
2966     enum DPP_ENUM___clockid_t_defined = 1;
2967 
2968 
2969     enum DPP_ENUM___clock_t_defined = 1;
2970     enum DPP_ENUM_____mbstate_t_defined = 1;
2971 
2972 
2973     enum DPP_ENUM______fpos_t_defined = 1;
2974 
2975 
2976     enum DPP_ENUM______fpos64_t_defined = 1;
2977 
2978 
2979     enum DPP_ENUM_____FILE_defined = 1;
2980 
2981 
2982     enum DPP_ENUM___FILE_defined = 1;
2983     enum DPP_ENUM__BITS_TYPES_H = 1;
2984 
2985 
2986 
2987 
2988 
2989 
2990     enum DPP_ENUM__BITS_TIME64_H = 1;
2991 
2992 
2993     enum DPP_ENUM___PTHREAD_MUTEX_HAVE_PREV = 1;
2994     enum DPP_ENUM__THREAD_SHARED_TYPES_H = 1;
2995 
2996 
2997     enum DPP_ENUM_FOPEN_MAX = 16;
2998 
2999 
3000     enum DPP_ENUM_L_ctermid = 9;
3001 
3002 
3003     enum DPP_ENUM_FILENAME_MAX = 4096;
3004 
3005 
3006     enum DPP_ENUM_TMP_MAX = 238328;
3007 
3008 
3009     enum DPP_ENUM_L_tmpnam = 20;
3010 
3011 
3012     enum DPP_ENUM__BITS_STDIO_LIM_H = 1;
3013 
3014 
3015     enum DPP_ENUM__BITS_STDINT_INTN_H = 1;
3016 
3017 
3018 
3019 
3020 
3021 
3022     enum DPP_ENUM__BITS_SS_FLAGS_H = 1;
3023 
3024 
3025     enum DPP_ENUM__BITS_SIGTHREAD_H = 1;
3026 
3027 
3028     enum DPP_ENUM_SIGSTKSZ = 8192;
3029 
3030 
3031     enum DPP_ENUM_MINSIGSTKSZ = 2048;
3032 
3033 
3034     enum DPP_ENUM__BITS_SIGSTACK_H = 1;
3035 
3036 
3037     enum DPP_ENUM___SIGRTMAX = 64;
3038 
3039 
3040     enum DPP_ENUM_SIGSYS = 31;
3041 
3042 
3043     enum DPP_ENUM_SIGPOLL = 29;
3044 
3045 
3046     enum DPP_ENUM_SIGURG = 23;
3047 
3048 
3049     enum DPP_ENUM_SIGTSTP = 20;
3050 
3051 
3052     enum DPP_ENUM_SIGSTOP = 19;
3053 
3054 
3055     enum DPP_ENUM_SIGCONT = 18;
3056 
3057 
3058     enum DPP_ENUM_SIGCHLD = 17;
3059 
3060 
3061     enum DPP_ENUM_SIGUSR2 = 12;
3062 
3063 
3064     enum DPP_ENUM_SIGUSR1 = 10;
3065 
3066 
3067     enum DPP_ENUM_SIGBUS = 7;
3068 
3069 
3070     enum DPP_ENUM_SIGPWR = 30;
3071 
3072 
3073     enum DPP_ENUM_SIGSTKFLT = 16;
3074 
3075 
3076     enum DPP_ENUM__BITS_SIGNUM_H = 1;
3077 
3078 
3079 
3080 
3081     enum DPP_ENUM___SIGRTMIN = 32;
3082     enum DPP_ENUM_SIGWINCH = 28;
3083 
3084 
3085     enum DPP_ENUM_SIGPROF = 27;
3086 
3087 
3088     enum DPP_ENUM_SIGVTALRM = 26;
3089 
3090 
3091     enum DPP_ENUM_SIGXFSZ = 25;
3092 
3093 
3094     enum DPP_ENUM_SIGXCPU = 24;
3095 
3096 
3097     enum DPP_ENUM_SIGTTOU = 22;
3098 
3099 
3100     enum DPP_ENUM_SIGTTIN = 21;
3101 
3102 
3103     enum DPP_ENUM_SIGALRM = 14;
3104 
3105 
3106     enum DPP_ENUM_SIGPIPE = 13;
3107 
3108 
3109     enum DPP_ENUM_SIGKILL = 9;
3110 
3111 
3112     enum DPP_ENUM_SIGTRAP = 5;
3113 
3114 
3115     enum DPP_ENUM_SIGQUIT = 3;
3116 
3117 
3118     enum DPP_ENUM_SIGHUP = 1;
3119 
3120 
3121     enum DPP_ENUM_SIGTERM = 15;
3122 
3123 
3124     enum DPP_ENUM_SIGSEGV = 11;
3125 
3126 
3127     enum DPP_ENUM_SIGFPE = 8;
3128 
3129 
3130     enum DPP_ENUM_SIGABRT = 6;
3131 
3132 
3133     enum DPP_ENUM_SIGILL = 4;
3134 
3135 
3136     enum DPP_ENUM_SIGINT = 2;
3137     enum DPP_ENUM__BITS_SIGNUM_GENERIC_H = 1;
3138     enum DPP_ENUM___SI_ASYNCIO_AFTER_SIGIO = 1;
3139 
3140 
3141     enum DPP_ENUM__BITS_SIGINFO_CONSTS_H = 1;
3142 
3143 
3144     enum DPP_ENUM__BITS_SIGINFO_ARCH_H = 1;
3145     enum DPP_ENUM__BITS_SIGEVENT_CONSTS_H = 1;
3146     enum DPP_ENUM__BITS_SIGCONTEXT_H = 1;
3147 
3148 
3149     enum DPP_ENUM_SIG_SETMASK = 2;
3150 
3151 
3152     enum DPP_ENUM_SIG_UNBLOCK = 1;
3153 
3154 
3155     enum DPP_ENUM_SIG_BLOCK = 0;
3156     enum DPP_ENUM_SA_SIGINFO = 4;
3157 
3158 
3159     enum DPP_ENUM_SA_NOCLDWAIT = 2;
3160 
3161 
3162     enum DPP_ENUM_SA_NOCLDSTOP = 1;
3163 
3164 
3165 
3166 
3167 
3168 
3169     enum DPP_ENUM__BITS_SIGACTION_H = 1;
3170     enum DPP_ENUM___have_pthread_attr_t = 1;
3171 
3172 
3173     enum DPP_ENUM__BITS_PTHREADTYPES_COMMON_H = 1;
3174 
3175 
3176     enum DPP_ENUM___PTHREAD_RWLOCK_INT_FLAGS_SHARED = 1;
3177     enum DPP_ENUM___PTHREAD_MUTEX_USE_UNION = 0;
3178 
3179 
3180     enum DPP_ENUM___PTHREAD_MUTEX_NUSERS_AFTER_KIND = 0;
3181 
3182 
3183     enum DPP_ENUM___PTHREAD_MUTEX_LOCK_ELISION = 1;
3184 
3185 
3186 
3187 
3188 
3189 
3190     enum DPP_ENUM___SIZEOF_PTHREAD_BARRIERATTR_T = 4;
3191 
3192 
3193     enum DPP_ENUM___SIZEOF_PTHREAD_RWLOCKATTR_T = 8;
3194 
3195 
3196     enum DPP_ENUM___SIZEOF_PTHREAD_CONDATTR_T = 4;
3197 
3198 
3199     enum DPP_ENUM___SIZEOF_PTHREAD_COND_T = 48;
3200 
3201 
3202     enum DPP_ENUM___SIZEOF_PTHREAD_MUTEXATTR_T = 4;
3203 
3204 
3205     enum DPP_ENUM___SIZEOF_PTHREAD_BARRIER_T = 32;
3206 
3207 
3208     enum DPP_ENUM___SIZEOF_PTHREAD_RWLOCK_T = 56;
3209 
3210 
3211     enum DPP_ENUM___SIZEOF_PTHREAD_MUTEX_T = 40;
3212 
3213 
3214     enum DPP_ENUM___SIZEOF_PTHREAD_ATTR_T = 56;
3215 
3216 
3217     enum DPP_ENUM__SYS_CDEFS_H = 1;
3218 
3219 
3220     enum DPP_ENUM__BITS_PTHREADTYPES_ARCH_H = 1;
3221 
3222 
3223 
3224 
3225     enum DPP_ENUM_CHARCLASS_NAME_MAX = 2048;
3226     enum DPP_ENUM_COLL_WEIGHTS_MAX = 255;
3227     enum DPP_ENUM___glibc_c99_flexarr_available = 1;
3228 
3229 
3230     enum DPP_ENUM__POSIX2_CHARCLASS_NAME_MAX = 14;
3231 
3232 
3233     enum DPP_ENUM__POSIX2_RE_DUP_MAX = 255;
3234     enum DPP_ENUM__POSIX2_LINE_MAX = 2048;
3235 
3236 
3237     enum DPP_ENUM__POSIX2_EXPR_NEST_MAX = 32;
3238 
3239 
3240     enum DPP_ENUM__POSIX2_COLL_WEIGHTS_MAX = 2;
3241 
3242 
3243 
3244 
3245     enum DPP_ENUM__POSIX2_BC_STRING_MAX = 1000;
3246 
3247 
3248 
3249 
3250     enum DPP_ENUM__POSIX2_BC_SCALE_MAX = 99;
3251 
3252 
3253 
3254 
3255     enum DPP_ENUM__POSIX2_BC_DIM_MAX = 2048;
3256 
3257 
3258 
3259 
3260     enum DPP_ENUM__POSIX2_BC_BASE_MAX = 99;
3261 
3262 
3263 
3264 
3265 
3266 
3267     enum DPP_ENUM__BITS_POSIX2_LIM_H = 1;
3268 
3269 
3270 
3271 
3272 
3273 
3274     enum DPP_ENUM__POSIX_CLOCKRES_MIN = 20000000;
3275 
3276 
3277 
3278 
3279 
3280     enum DPP_ENUM__POSIX_TZNAME_MAX = 6;
3281 
3282 
3283 
3284 
3285     enum DPP_ENUM__POSIX_TTY_NAME_MAX = 9;
3286 
3287 
3288 
3289 
3290 
3291     enum DPP_ENUM__POSIX_TIMER_MAX = 32;
3292 
3293 
3294 
3295 
3296     enum DPP_ENUM__POSIX_SYMLOOP_MAX = 8;
3297 
3298 
3299 
3300 
3301 
3302     enum DPP_ENUM__POSIX_SYMLINK_MAX = 255;
3303 
3304 
3305 
3306 
3307     enum DPP_ENUM__POSIX_STREAM_MAX = 8;
3308 
3309 
3310 
3311 
3312     enum DPP_ENUM__POSIX_SSIZE_MAX = 32767;
3313 
3314 
3315 
3316 
3317     enum DPP_ENUM__POSIX_SIGQUEUE_MAX = 32;
3318 
3319 
3320     enum DPP_ENUM__POSIX_SEM_VALUE_MAX = 32767;
3321 
3322 
3323     enum DPP_ENUM__POSIX_SEM_NSEMS_MAX = 256;
3324 
3325 
3326     enum DPP_ENUM__POSIX_RTSIG_MAX = 8;
3327 
3328 
3329 
3330 
3331 
3332 
3333 
3334     enum DPP_ENUM__POSIX_RE_DUP_MAX = 255;
3335 
3336 
3337 
3338 
3339     enum DPP_ENUM__POSIX_PIPE_BUF = 512;
3340 
3341 
3342     enum DPP_ENUM__POSIX_PATH_MAX = 256;
3343 
3344 
3345     enum DPP_ENUM__POSIX_OPEN_MAX = 20;
3346 
3347 
3348     enum DPP_ENUM__POSIX_NGROUPS_MAX = 8;
3349 
3350 
3351 
3352 
3353     enum DPP_ENUM__POSIX_NAME_MAX = 14;
3354 
3355 
3356 
3357 
3358 
3359 
3360     enum DPP_ENUM__POSIX_MQ_PRIO_MAX = 32;
3361 
3362 
3363 
3364 
3365     enum DPP_ENUM__POSIX_MQ_OPEN_MAX = 8;
3366 
3367 
3368     enum DPP_ENUM__POSIX_MAX_INPUT = 255;
3369 
3370 
3371     enum DPP_ENUM__POSIX_MAX_CANON = 255;
3372 
3373 
3374     enum DPP_ENUM__POSIX_LOGIN_NAME_MAX = 9;
3375 
3376 
3377 
3378 
3379     enum DPP_ENUM__POSIX_LINK_MAX = 8;
3380 
3381 
3382 
3383 
3384     enum DPP_ENUM__POSIX_HOST_NAME_MAX = 255;
3385 
3386 
3387     enum DPP_ENUM__POSIX_DELAYTIMER_MAX = 32;
3388 
3389 
3390     enum DPP_ENUM__POSIX_CHILD_MAX = 25;
3391 
3392 
3393     enum DPP_ENUM__POSIX_ARG_MAX = 4096;
3394 
3395 
3396     enum DPP_ENUM__POSIX_AIO_MAX = 1;
3397 
3398 
3399     enum DPP_ENUM__POSIX_AIO_LISTIO_MAX = 2;
3400     enum DPP_ENUM__BITS_POSIX1_LIM_H = 1;
3401 
3402 
3403 
3404 
3405 
3406 
3407 
3408     enum DPP_ENUM_NCARGS = 131072;
3409 
3410 
3411     enum DPP_ENUM_NOFILE = 256;
3412 
3413 
3414 
3415 
3416 
3417 
3418 
3419     enum DPP_ENUM_MAXSYMLINKS = 20;
3420 
3421 
3422 
3423 
3424 
3425 
3426     enum DPP_ENUM_MQ_PRIO_MAX = 32768;
3427 
3428 
3429     enum DPP_ENUM_HOST_NAME_MAX = 64;
3430 
3431 
3432     enum DPP_ENUM___HAVE_GENERIC_SELECTION = 1;
3433 
3434 
3435     enum DPP_ENUM_LOGIN_NAME_MAX = 256;
3436 
3437 
3438     enum DPP_ENUM__SYS_PARAM_H = 1;
3439 
3440 
3441     enum DPP_ENUM_TTY_NAME_MAX = 32;
3442 
3443 
3444     enum DPP_ENUM_DELAYTIMER_MAX = 2147483647;
3445 
3446 
3447     enum DPP_ENUM_PTHREAD_STACK_MIN = 16384;
3448 
3449 
3450     enum DPP_ENUM_AIO_PRIO_DELTA_MAX = 20;
3451 
3452 
3453     enum DPP_ENUM__POSIX_THREAD_THREADS_MAX = 64;
3454 
3455 
3456 
3457 
3458 
3459 
3460     enum DPP_ENUM__POSIX_THREAD_DESTRUCTOR_ITERATIONS = 4;
3461 
3462 
3463 
3464 
3465     enum DPP_ENUM_PTHREAD_KEYS_MAX = 1024;
3466 
3467 
3468     enum DPP_ENUM__POSIX_THREAD_KEYS_MAX = 128;
3469     enum DPP_ENUM___GLIBC_USE_IEC_60559_TYPES_EXT = 0;
3470 
3471 
3472 
3473 
3474     enum DPP_ENUM_DEV_BSIZE = 512;
3475     enum DPP_ENUM__SYS_SELECT_H = 1;
3476 
3477 
3478     enum DPP_ENUM___GLIBC_USE_IEC_60559_FUNCS_EXT = 0;
3479 
3480 
3481     enum DPP_ENUM___GLIBC_USE_IEC_60559_BFP_EXT = 0;
3482 
3483 
3484     enum DPP_ENUM___GLIBC_USE_LIB_EXT2 = 0;
3485 
3486 
3487 
3488 
3489     enum DPP_ENUM___HAVE_FLOAT64X_LONG_DOUBLE = 1;
3490     enum DPP_ENUM___HAVE_FLOAT64X = 1;
3491 
3492 
3493     enum DPP_ENUM___HAVE_DISTINCT_FLOAT128 = 0;
3494 
3495 
3496     enum DPP_ENUM___HAVE_FLOAT128 = 0;
3497     enum DPP_ENUM__SYS_TIME_H = 1;
3498     enum DPP_ENUM___HAVE_FLOATN_NOT_TYPEDEF = 0;
3499 
3500 
3501 
3502 
3503 
3504 
3505 
3506     enum DPP_ENUM___HAVE_DISTINCT_FLOAT64X = 0;
3507     enum DPP_ENUM___HAVE_DISTINCT_FLOAT32X = 0;
3508 
3509 
3510     enum DPP_ENUM___HAVE_DISTINCT_FLOAT64 = 0;
3511 
3512 
3513     enum DPP_ENUM___HAVE_DISTINCT_FLOAT32 = 0;
3514 
3515 
3516 
3517 
3518     enum DPP_ENUM___HAVE_FLOAT128X = 0;
3519 
3520 
3521     enum DPP_ENUM___HAVE_FLOAT32X = 1;
3522 
3523 
3524     enum DPP_ENUM___HAVE_FLOAT64 = 1;
3525 
3526 
3527     enum DPP_ENUM___HAVE_FLOAT32 = 1;
3528 
3529 
3530     enum DPP_ENUM___HAVE_FLOAT16 = 0;
3531 
3532 
3533 
3534 
3535 
3536 
3537     enum DPP_ENUM__BITS_ERRNO_H = 1;
3538     enum DPP_ENUM__BITS_BYTESWAP_H = 1;
3539 
3540 
3541     enum DPP_ENUM__SYS_TYPES_H = 1;
3542 
3543 
3544     enum DPP_ENUM_MAXHOSTNAMELEN = 64;
3545 
3546 
3547 
3548 
3549     enum DPP_ENUM_EXEC_PAGESIZE = 4096;
3550 
3551 
3552     enum DPP_ENUM_HZ = 100;
3553 
3554 
3555 
3556 
3557     enum DPP_ENUM_EHWPOISON = 133;
3558 
3559 
3560     enum DPP_ENUM_ERFKILL = 132;
3561 
3562 
3563     enum DPP_ENUM_ENOTRECOVERABLE = 131;
3564 
3565 
3566     enum DPP_ENUM_EOWNERDEAD = 130;
3567 
3568 
3569     enum DPP_ENUM_EKEYREJECTED = 129;
3570 
3571 
3572     enum DPP_ENUM_EKEYREVOKED = 128;
3573 
3574 
3575 
3576 
3577     enum DPP_ENUM_EKEYEXPIRED = 127;
3578 
3579 
3580     enum DPP_ENUM_ENOKEY = 126;
3581 
3582 
3583 
3584 
3585     enum DPP_ENUM_ECANCELED = 125;
3586 
3587 
3588 
3589 
3590     enum DPP_ENUM_EMEDIUMTYPE = 124;
3591 
3592 
3593 
3594 
3595     enum DPP_ENUM_ENOMEDIUM = 123;
3596 
3597 
3598 
3599 
3600     enum DPP_ENUM_EDQUOT = 122;
3601 
3602 
3603 
3604 
3605     enum DPP_ENUM_EREMOTEIO = 121;
3606 
3607 
3608 
3609 
3610     enum DPP_ENUM_EISNAM = 120;
3611 
3612 
3613 
3614 
3615     enum DPP_ENUM_ENAVAIL = 119;
3616 
3617 
3618 
3619 
3620     enum DPP_ENUM_ENOTNAM = 118;
3621 
3622 
3623     enum DPP_ENUM_EUCLEAN = 117;
3624 
3625 
3626 
3627 
3628     enum DPP_ENUM_ESTALE = 116;
3629 
3630 
3631 
3632 
3633     enum DPP_ENUM_EINPROGRESS = 115;
3634 
3635 
3636     enum DPP_ENUM_EALREADY = 114;
3637 
3638 
3639     enum DPP_ENUM_EHOSTUNREACH = 113;
3640 
3641 
3642 
3643 
3644     enum DPP_ENUM_EHOSTDOWN = 112;
3645 
3646 
3647     enum DPP_ENUM_ECONNREFUSED = 111;
3648 
3649 
3650 
3651 
3652     enum DPP_ENUM_ETIMEDOUT = 110;
3653 
3654 
3655     enum DPP_ENUM_ETOOMANYREFS = 109;
3656 
3657 
3658     enum DPP_ENUM_ESHUTDOWN = 108;
3659 
3660 
3661     enum DPP_ENUM_ENOTCONN = 107;
3662 
3663 
3664     enum DPP_ENUM_EISCONN = 106;
3665 
3666 
3667     enum DPP_ENUM_ENOBUFS = 105;
3668 
3669 
3670     enum DPP_ENUM_ECONNRESET = 104;
3671 
3672 
3673     enum DPP_ENUM_ECONNABORTED = 103;
3674 
3675 
3676     enum DPP_ENUM_ENETRESET = 102;
3677 
3678 
3679     enum DPP_ENUM_ENETUNREACH = 101;
3680 
3681 
3682     enum DPP_ENUM_ENETDOWN = 100;
3683 
3684 
3685     enum DPP_ENUM_EADDRNOTAVAIL = 99;
3686 
3687 
3688 
3689 
3690 
3691     enum DPP_ENUM_EADDRINUSE = 98;
3692 
3693 
3694     enum DPP_ENUM_EAFNOSUPPORT = 97;
3695 
3696 
3697     enum DPP_ENUM_EPFNOSUPPORT = 96;
3698 
3699 
3700     enum DPP_ENUM_EOPNOTSUPP = 95;
3701 
3702 
3703     enum DPP_ENUM_ESOCKTNOSUPPORT = 94;
3704 
3705 
3706     enum DPP_ENUM_EPROTONOSUPPORT = 93;
3707 
3708 
3709     enum DPP_ENUM_ENOPROTOOPT = 92;
3710 
3711 
3712     enum DPP_ENUM_EPROTOTYPE = 91;
3713 
3714 
3715     enum DPP_ENUM_EMSGSIZE = 90;
3716 
3717 
3718     enum DPP_ENUM___BIT_TYPES_DEFINED__ = 1;
3719 
3720 
3721     enum DPP_ENUM_EDESTADDRREQ = 89;
3722 
3723 
3724     enum DPP_ENUM_ENOTSOCK = 88;
3725 
3726 
3727     enum DPP_ENUM_EUSERS = 87;
3728 
3729 
3730     enum DPP_ENUM_ESTRPIPE = 86;
3731 
3732 
3733     enum DPP_ENUM_ERESTART = 85;
3734 
3735 
3736 
3737 
3738     enum DPP_ENUM_EILSEQ = 84;
3739 
3740 
3741 
3742 
3743     enum DPP_ENUM_ELIBEXEC = 83;
3744 
3745 
3746 
3747 
3748     enum DPP_ENUM_ELIBMAX = 82;
3749 
3750 
3751 
3752 
3753     enum DPP_ENUM_ELIBSCN = 81;
3754 
3755 
3756     enum DPP_ENUM_ELIBBAD = 80;
3757 
3758 
3759     enum DPP_ENUM_ELIBACC = 79;
3760 
3761 
3762     enum DPP_ENUM__SYS_UCONTEXT_H = 1;
3763 
3764 
3765     enum DPP_ENUM_EREMCHG = 78;
3766 
3767 
3768     enum DPP_ENUM_EBADFD = 77;
3769 
3770 
3771     enum DPP_ENUM_ENOTUNIQ = 76;
3772 
3773 
3774     enum DPP_ENUM_EOVERFLOW = 75;
3775 
3776 
3777     enum DPP_ENUM_EBADMSG = 74;
3778 
3779 
3780 
3781 
3782     enum DPP_ENUM_EDOTDOT = 73;
3783 
3784 
3785     enum DPP_ENUM_EMULTIHOP = 72;
3786 
3787 
3788     enum DPP_ENUM___NGREG = 23;
3789 
3790 
3791     enum DPP_ENUM_EPROTO = 71;
3792 
3793 
3794 
3795 
3796     enum DPP_ENUM_ECOMM = 70;
3797 
3798 
3799     enum DPP_ENUM_ESRMNT = 69;
3800 
3801 
3802     enum DPP_ENUM_EADV = 68;
3803 
3804 
3805     enum DPP_ENUM_ENOLINK = 67;
3806 
3807 
3808     enum DPP_ENUM_EREMOTE = 66;
3809 
3810 
3811     enum DPP_ENUM_ENOPKG = 65;
3812 
3813 
3814     enum DPP_ENUM_ENONET = 64;
3815 
3816 
3817     enum DPP_ENUM_ENOSR = 63;
3818 
3819 
3820     enum DPP_ENUM_ETIME = 62;
3821 
3822 
3823     enum DPP_ENUM_ENODATA = 61;
3824 
3825 
3826     enum DPP_ENUM_ENOSTR = 60;
3827 
3828 
3829     enum DPP_ENUM_EBFONT = 59;
3830 
3831 
3832 
3833 
3834     enum DPP_ENUM_EBADSLT = 57;
3835 
3836 
3837     enum DPP_ENUM_EBADRQC = 56;
3838 
3839 
3840     enum DPP_ENUM_ENOANO = 55;
3841 
3842 
3843     enum DPP_ENUM_EXFULL = 54;
3844 
3845 
3846     enum DPP_ENUM_EBADR = 53;
3847 
3848 
3849     enum DPP_ENUM_EBADE = 52;
3850 
3851 
3852     enum DPP_ENUM_EL2HLT = 51;
3853 
3854 
3855     enum DPP_ENUM_ENOCSI = 50;
3856 
3857 
3858     enum DPP_ENUM_EUNATCH = 49;
3859 
3860 
3861     enum DPP_ENUM_ELNRNG = 48;
3862 
3863 
3864     enum DPP_ENUM_EL3RST = 47;
3865 
3866 
3867 
3868 
3869     enum DPP_ENUM_EL3HLT = 46;
3870 
3871 
3872 
3873 
3874     enum DPP_ENUM_EL2NSYNC = 45;
3875 
3876 
3877     enum DPP_ENUM_ECHRNG = 44;
3878 
3879 
3880     enum DPP_ENUM_EIDRM = 43;
3881     enum DPP_ENUM_ENOMSG = 42;
3882     enum DPP_ENUM_ELOOP = 40;
3883 
3884 
3885 
3886 
3887     enum DPP_ENUM_ENOTEMPTY = 39;
3888     enum DPP_ENUM_ENOSYS = 38;
3889 
3890 
3891 
3892 
3893     enum DPP_ENUM___GNUC_VA_LIST = 1;
3894 
3895 
3896     enum DPP_ENUM_ENOLCK = 37;
3897 
3898 
3899     enum DPP_ENUM_ENAMETOOLONG = 36;
3900 
3901 
3902     enum DPP_ENUM_EDEADLK = 35;
3903 
3904 
3905 
3906 
3907     enum DPP_ENUM_ERANGE = 34;
3908 
3909 
3910     enum DPP_ENUM_EDOM = 33;
3911 
3912 
3913     enum DPP_ENUM_EPIPE = 32;
3914 
3915 
3916     enum DPP_ENUM_EMLINK = 31;
3917 
3918 
3919     enum DPP_ENUM_EROFS = 30;
3920 
3921 
3922     enum DPP_ENUM_ESPIPE = 29;
3923 
3924 
3925     enum DPP_ENUM_ENOSPC = 28;
3926 
3927 
3928     enum DPP_ENUM_EFBIG = 27;
3929 
3930 
3931     enum DPP_ENUM_ETXTBSY = 26;
3932 
3933 
3934     enum DPP_ENUM_ENOTTY = 25;
3935 
3936 
3937     enum DPP_ENUM_EMFILE = 24;
3938 
3939 
3940     enum DPP_ENUM_ENFILE = 23;
3941 
3942 
3943     enum DPP_ENUM_EINVAL = 22;
3944 
3945 
3946     enum DPP_ENUM_EISDIR = 21;
3947 
3948 
3949     enum DPP_ENUM_ENOTDIR = 20;
3950 
3951 
3952     enum DPP_ENUM_ENODEV = 19;
3953 
3954 
3955     enum DPP_ENUM_EXDEV = 18;
3956 
3957 
3958     enum DPP_ENUM_EEXIST = 17;
3959 
3960 
3961     enum DPP_ENUM_EBUSY = 16;
3962 
3963 
3964     enum DPP_ENUM_ENOTBLK = 15;
3965 
3966 
3967     enum DPP_ENUM_EFAULT = 14;
3968 
3969 
3970     enum DPP_ENUM_EACCES = 13;
3971 
3972 
3973     enum DPP_ENUM_ENOMEM = 12;
3974 
3975 
3976     enum DPP_ENUM_EAGAIN = 11;
3977 
3978 
3979     enum DPP_ENUM_ECHILD = 10;
3980 
3981 
3982     enum DPP_ENUM_EBADF = 9;
3983 
3984 
3985     enum DPP_ENUM_ENOEXEC = 8;
3986 
3987 
3988     enum DPP_ENUM_E2BIG = 7;
3989 
3990 
3991     enum DPP_ENUM_ENXIO = 6;
3992 
3993 
3994     enum DPP_ENUM_EIO = 5;
3995 
3996 
3997     enum DPP_ENUM_EINTR = 4;
3998 
3999 
4000     enum DPP_ENUM_ESRCH = 3;
4001 
4002 
4003     enum DPP_ENUM_ENOENT = 2;
4004 
4005 
4006     enum DPP_ENUM_EPERM = 1;
4007     enum DPP_ENUM__ALLOCA_H = 1;
4008     enum DPP_ENUM_ZAP_MAXNAMELEN = 256;
4009 
4010 
4011 
4012 
4013     enum DPP_ENUM_ZAP_OLDMAXVALUELEN = 1024;
4014 
4015 
4016     enum DPP_ENUM_ZFS_MAX_DATASET_NAME_LEN = 256;
4017 
4018 
4019     enum DPP_ENUM_ZPROP_MAX_COMMENT = 32;
4020     enum DPP_ENUM_ZFS_WRITTEN_PROP_PREFIX_LEN = 8;
4021     enum DPP_ENUM_DEFAULT_PBKDF2_ITERATIONS = 350000;
4022 
4023 
4024     enum DPP_ENUM_MIN_PBKDF2_ITERATIONS = 100000;
4025     enum DPP_ENUM_ZPOOL_NO_REWIND = 1;
4026 
4027 
4028     enum DPP_ENUM_ZPOOL_NEVER_REWIND = 2;
4029 
4030 
4031     enum DPP_ENUM_ZPOOL_TRY_REWIND = 4;
4032 
4033 
4034     enum DPP_ENUM_ZPOOL_DO_REWIND = 8;
4035 
4036 
4037     enum DPP_ENUM_ZPOOL_EXTREME_REWIND = 16;
4038 
4039 
4040     enum DPP_ENUM_ZPOOL_REWIND_MASK = 28;
4041 
4042 
4043     enum DPP_ENUM_ZPOOL_REWIND_POLICIES = 31;
4044     enum DPP_ENUM_VS_ZIO_TYPES = 6;
4045 
4046 
4047     enum DPP_ENUM_VDEV_L_HISTO_BUCKETS = 37;
4048 
4049 
4050     enum DPP_ENUM_VDEV_RQ_HISTO_BUCKETS = 25;
4051     enum DPP_ENUM_ZVOL_MAJOR = 230;
4052 
4053 
4054     enum DPP_ENUM_ZVOL_MINOR_BITS = 4;
4055     enum DPP_ENUM_ZVOL_DEFAULT_BLOCKSIZE = 8192;
4056     enum DPP_ENUM_NV_VERSION = 0;
4057 
4058 
4059     enum DPP_ENUM_NV_ENCODE_NATIVE = 0;
4060 
4061 
4062     enum DPP_ENUM_NV_ENCODE_XDR = 1;
4063 }
4064 
4065 
4066 struct re_dfa_t;
4067 
4068 /+
4069  work towards Dlang wrapper for libzfs-core
4070 +/
4071 
4072 
4073 
4074 
4075 import std.socket:Socket;
4076 import std.string:toStringz, fromStringz;
4077 import std.exception;
4078 import taggedalgebraic;
4079 import std.conv:to;
4080 import std.typecons:tuple;
4081 
4082 alias toCString = toStringz;
4083 alias fromCString = fromStringz;
4084 
4085 struct SILdoc {string value; }
4086 
4087 
4088 
4089 
4090 
4091 
4092 extern(C) __gshared int g_fd, g_refcount;
4093 
4094 enum DatasetType
4095 {
4096  zfs = LZC_DATSET_TYPE_ZFS,
4097  zvol = LZC_DATSET_TYPE_ZVOL,
4098 }
4099 
4100 
4101 enum VdevType
4102 {
4103  root,
4104  mirror,
4105  replacing,
4106  raidz,
4107  disk,
4108  file,
4109  missing,
4110  hole,
4111  spare,
4112  log,
4113  l2cache,
4114 }
4115 
4116 enum PoolStatus
4117 {
4118  corruptCache,
4119  missingDevR,
4120  missingDevNr,
4121  corruptLabelR,
4122  corruptLabelNr,
4123  badGUIDSum,
4124  corruptPool,
4125  corruptData,
4126  failingDev,
4127  versionNewer,
4128  hostidMismatch,
4129  hosidActive,
4130  hostidRequired,
4131  ioFailureWait,
4132  ioFailureContinue,
4133  ioFailureMap,
4134  badLog,
4135  errata,
4136 
4137 
4138 
4139 
4140 
4141 
4142 
4143  unsupFeatRead,
4144  unsupFeatWrite,
4145 
4146 
4147 
4148 
4149 
4150 
4151  faultedDevR,
4152  faultedDevNr,
4153 
4154 
4155 
4156 
4157 
4158 
4159  versionOlder,
4160  featDisabled,
4161  resilvering,
4162  offlineDev,
4163  removedDev,
4164 
4165 
4166 
4167 
4168  ok,
4169 }
4170 
4171 
4172 enum PoolState
4173 {
4174  active,
4175  exported,
4176  destroyed,
4177  spare,
4178  l2cache,
4179  uninitialized,
4180  unavail,
4181  potentiallyActive
4182 }
4183 
4184 
4185 
4186 enum PoolProperty
4187 {
4188  cont,
4189  inval,
4190  name,
4191  size,
4192  capacity,
4193  altroot,
4194  health,
4195  guid,
4196  version_,
4197  bootfs,
4198  delegation,
4199  autoReplace,
4200  cacheFile,
4201  failureMode,
4202  listSnaps,
4203  autoExpand,
4204  dedupDitto,
4205  dedupRatio,
4206  free,
4207  allocated,
4208  readOnly,
4209  ashift,
4210  comment,
4211  expandSize,
4212  freeing,
4213  fragmentation,
4214  leaked,
4215  maxBlockSize,
4216  tName,
4217  maxNodeSize,
4218  multiHost,
4219  poolNumProps,
4220 }
4221 enum DatasetProperty
4222 {
4223  cont,
4224  bad,
4225  type,
4226  creation,
4227  used,
4228  available,
4229  referenced,
4230  compressRatio,
4231  mounted,
4232  origin,
4233  quota,
4234  reservation,
4235  volSize,
4236  volBlockSize,
4237  recordsize,
4238  mountpoint,
4239  sharenfs,
4240  checksum,
4241  compression,
4242  atime,
4243  devices,
4244  exec,
4245  setuid,
4246  readonly,
4247  zoned,
4248  snapdir,
4249  private_,
4250  aclinherit,
4251  createTXG,
4252  name,
4253  canmount,
4254  iscsioptions,
4255  xattr,
4256  numclones,
4257  copies,
4258  version_,
4259  utf8only,
4260  normalize,
4261  case_,
4262  vscan,
4263  nbmand,
4264  sharesmb,
4265  refquota,
4266  refreservation,
4267  guid,
4268  primarycache,
4269  secondarycache,
4270  usedsnap,
4271  usedds,
4272  usedchild,
4273  usedrefreserv,
4274  useraccounting,
4275  stmfShareinfo,
4276  deferDestroy,
4277  userrefs,
4278  logbias,
4279  unique,
4280  objsetid,
4281  dedup,
4282  mlslabel,
4283  sync,
4284  dnodeSize,
4285  refratio,
4286  written,
4287  clones,
4288  logicalused,
4289  logicalreferenced,
4290  inconsistent,
4291  volmode,
4292  filesystemLimit,
4293  snapshotLimit,
4294  filesystemCount,
4295  snapshotCount,
4296  snapdev,
4297  acltype,
4298  selinuxContext,
4299  selinuxFsContext,
4300  selinuxDefContext,
4301  selinuxRootContext,
4302  relatime,
4303  redundantMetadata,
4304  overlay,
4305  prevSnap,
4306  receiveResumeToken,
4307  encryption,
4308  keyLocation,
4309  keyFormat,
4310  pBKDF2Salt,
4311  pBKDF2Iters,
4312  encryptionRoot,
4313  keyGUID,
4314  keyStatus,
4315  remapTXG,
4316  datasetNumProps,
4317 }
4318 
4319 
4320 
4321 enum ZfsError
4322 {
4323  success = 0,
4324  nomem = 2000 ,
4325  badprop,
4326  propreadonly,
4327  proptype,
4328  propnoninherit,
4329  propspace,
4330  badtype,
4331  busy,
4332  exists,
4333  noent,
4334  badstream,
4335  dsreadonly,
4336  voltoobig,
4337  invalidname,
4338  badrestore,
4339  badbackup,
4340  badtarget,
4341  nodevice,
4342  baddev,
4343  noreplicas,
4344  resilvering,
4345  badversion,
4346  poolunavail,
4347  devoverflow,
4348  badpath,
4349  crosstarget,
4350  zoned,
4351  mountfailed,
4352  umountfailed,
4353  unsharenfsfailed,
4354  sharenfsfailed,
4355  perm,
4356  nospc,
4357  fault,
4358  io,
4359  intr,
4360  isspare,
4361  invalconfig,
4362  recursive,
4363  nohistory,
4364  poolprops,
4365  poolNotsup,
4366  poolInvalarg,
4367  nametoolong,
4368  openfailed,
4369  nocap,
4370  labelfailed,
4371  badwho,
4372  badperm,
4373  badpermset,
4374  nodelegation,
4375  unsharesmbfailed,
4376  sharesmbfailed,
4377  badcache,
4378  isl2CACHE,
4379  vdevnotsup,
4380  notsup,
4381  activeSpare,
4382  unplayedLogs,
4383  reftagRele,
4384  reftagHold,
4385  tagtoolong,
4386  pipefailed,
4387  threadcreatefailed,
4388  postsplitOnline,
4389  scrubbing,
4390  noScrub,
4391  diff,
4392  diffdata,
4393  poolreadonly,
4394  unknown,
4395 }
4396 
4397 
4398 
4399 enum VdevState
4400 {
4401  unknown,
4402  closed,
4403  offline,
4404  removed,
4405  cantOpen,
4406  faulted,
4407  degraded,
4408  healthy,
4409 }
4410 
4411 
4412 
4413 enum VdevAux
4414 {
4415  none,
4416  openFailed,
4417  corruptData,
4418  noReplicas,
4419  badGUIDSum,
4420  tooSmall,
4421  badLabel,
4422  versionNewer,
4423  versionOlder,
4424  unsupFeat,
4425  spared,
4426  errExceeded,
4427  ioFailure,
4428  badLog,
4429  external,
4430  splitPool,
4431 }
4432 
4433 
4434 
4435 struct ZfsErrorResult
4436 {
4437  int num;
4438  string text;
4439 }
4440 
4441 
4442 shared static this()
4443 {
4444  enforce(libzfs_core_init() == 0, "Error initialising ZFS");
4445 }
4446 
4447 shared static ~this()
4448 {
4449  libzfs_core_fini();
4450 }
4451 
4452 version(None)
4453 {
4454  auto toList(string[string] args)
4455  {
4456   nvlist_t** pNvList = nvlist_alloc(nvlistp,1,0);
4457   enforce(pNvList !is null, "nvlist_alloca failed");
4458   scope(exit)
4459    nvlist_free(pNvList);
4460   return dictToNvList(args,pNvList);
4461  }
4462 
4463  auto asDict(nv_list* list)
4464  {
4465   string[string] ret;
4466 
4467   pair = nvlist_next_nvpair(list,null);
4468   while (pair !is null)
4469   {
4470    auto name = nvpair_name(pair).fromCString;
4471    auto id = type(pair);
4472   }
4473  }
4474 
4475  auto type(nvpair* pair)
4476  {
4477   auto id = nvpair_typie(pair);
4478  }
4479 }
4480 
4481 enum NvType
4482 {
4483  unknown = DATA_TYPE_UNKNOWN,
4484  boolean = DATA_TYPE_BOOLEAN,
4485  byte_ = DATA_TYPE_BYTE,
4486  short_ = DATA_TYPE_INT16,
4487  ushort_ = DATA_TYPE_UINT16,
4488  int_ = DATA_TYPE_INT32,
4489  uint_ = DATA_TYPE_UINT32,
4490  long_ = DATA_TYPE_INT64,
4491  ulong_ = DATA_TYPE_UINT64,
4492  string_ = DATA_TYPE_STRING,
4493  byteArray = DATA_TYPE_BYTE_ARRAY,
4494  shortArray = DATA_TYPE_INT16_ARRAY,
4495  ushortArray = DATA_TYPE_UINT16_ARRAY,
4496  intArray = DATA_TYPE_INT32_ARRAY,
4497  uintArray = DATA_TYPE_UINT32_ARRAY,
4498  longArray = DATA_TYPE_INT64_ARRAY,
4499  ulongArray = DATA_TYPE_UINT64_ARRAY,
4500  stringArray = DATA_TYPE_STRING_ARRAY,
4501  hrTime = DATA_TYPE_HRTIME,
4502  nvList = DATA_TYPE_NVLIST,
4503  nvListArray = DATA_TYPE_NVLIST_ARRAY,
4504  booleanValue = DATA_TYPE_BOOLEAN_VALUE,
4505  int8 = DATA_TYPE_INT8,
4506  uint8 = DATA_TYPE_UINT8,
4507  booleanArray = DATA_TYPE_BOOLEAN_ARRAY,
4508  int8Array = DATA_TYPE_INT8_ARRAY,
4509  uint8Array = DATA_TYPE_UINT8_ARRAY,
4510  double_ = DATA_TYPE_DOUBLE
4511 }
4512 
4513 union ZfsValueUnion
4514 {
4515  bool boolean;
4516  byte byte_;
4517  char int8Value;
4518  ubyte ubyteValue;
4519  short short_;
4520  ushort ushort_;
4521  int int_;
4522  uint uint_;
4523  long long_;
4524  ulong ulong_;
4525  string string_;
4526  bool[] booleanArray;
4527  char[] charArray;
4528  ubyte[] ubyteArray;
4529  short[] shortArray;
4530  ushort[] ushortArray;
4531  int[] intArray;
4532  uint[] uintArray;
4533  long[] longArray;
4534  ulong[] ulongArray;
4535  string[] stringArray;
4536 
4537 
4538 
4539 
4540  double double_;
4541  ZfsValueUnion[] valueArray;
4542  ZfsValueUnion[string] valueDict;
4543 }
4544 
4545 alias ZfsValue = TaggedAlgebraic!ZfsValueUnion;
4546 
4547 /+
4548 nvlist_t* asList(ZfsValue[string] values)
4549 {
4550  foreach(entry;values.byKeyValue)
4551  {
4552   final switch(entry.value.kind)
4553   {
4554    case ZfsValue.Kind.valueDict:
4555     nvlist_add_nvlist(list,entry.key.toCString,entry.value.asCValue);
4556     break;
4557 
4558    case ZfsValue.Kind.valueArray:
4559     nvlist_add_array(list,entry.key.toCString,entry.value.asCValue);
4560     break;
4561 
4562    case ZfsValue.
4563 +/
4564 
4565 string[string] zfsIoctl(zfs_ioc_t ioc, string name, string[string] args)
4566 {
4567  import std.format:format;
4568  auto props = getProperties(args);
4569  scope(exit)
4570   nvlistFree(props);
4571  nvlist_t* resultp;
4572  auto ret = lzc_ioctl(ioc,name.toCString, props,&resultp);
4573  enforce(ret == 0, format!"error calling lzc_ioctl: %s"(ret));
4574  return resultp.asDict;
4575 }
4576 extern(C) size_t strlcpy ( char * dest, const(char) * src, size_t size);
4577 
4578 
4579 struct zfs_cmd_t
4580 {
4581  char[4096] zc_name;
4582  ulong zc_nvlist_src;
4583  ulong zc_nvlist_src_size;
4584  ulong zc_nvlist_dst;
4585  ulong zc_nvlist_dst_size;
4586  boolean_t zc_nvlist_dst_filled;
4587  int zc_pad2;
4588 
4589 
4590 
4591 
4592 
4593  ulong zc_history;
4594  char[4096 * 2] zc_value;
4595 
4596  ulong zc_guid;
4597  ulong zc_nvlist_conf;
4598  ulong zc_nvlist_conf_size;
4599  ulong zc_cookie;
4600  ulong zc_objset_type;
4601  ulong zc_perm_action;
4602  ulong zc_history_len;
4603  ulong zc_history_offset;
4604  ulong zc_obj;
4605  ulong zc_iflags;
4606 
4607 
4608 
4609 
4610  uint zc_defer_destroy;
4611  uint zc_flags;
4612  ulong zc_action_handle;
4613  int zc_cleanup_fd;
4614  ubyte zc_simple;
4615  ubyte[3] zc_pad;
4616  ulong zc_sendobj;
4617  ulong zc_fromobj;
4618  ulong zc_createtxg;
4619 
4620 }
4621 int lzc_ioctl(zfs_ioc_t ioc, const(char)* name, nvlist_t* source, nvlist_t** resultp)
4622 {
4623  import std.algorithm:max;
4624  import core.sys.posix.sys.ioctl;
4625  zfs_cmd_t zc = {zc_name:"\0"};
4626  int error = 0;
4627  char *packed = null;
4628  size_t size = 0;
4629 
4630 
4631 
4632 
4633 version(ZFS_DEBUG)
4634 {
4635  if (ioc == fail_ioc_cmd)
4636   return (fail_ioc_err);
4637 }
4638 
4639  if (name !is null)
4640   cast (void) strlcpy(zc.zc_name.ptr, name, zc.zc_name.sizeof);
4641 
4642  if (source !is null) {
4643   packed = fnvlist_pack(source, &size);
4644   zc.zc_nvlist_src = cast(ulong)cast(uint*)packed;
4645   zc.zc_nvlist_src_size = size;
4646  }
4647 
4648  if (resultp !is null) {
4649   *resultp = null;
4650   if (ioc == ZFS_IOC_CHANNEL_PROGRAM) {
4651    zc.zc_nvlist_dst_size = fnvlist_lookup_uint64(source, "memlimit");
4652   } else {
4653    zc.zc_nvlist_dst_size = max(size * 2, 128 * 1024);
4654   }
4655   zc.zc_nvlist_dst = cast(ulong)cast(uint*) malloc(zc.zc_nvlist_dst_size);
4656   if (zc.zc_nvlist_dst == 0UL) {
4657    error = 12;
4658    goto out_;
4659   }
4660  }
4661 
4662  while (ioctl(g_fd, ioc, &zc) != 0) {
4663 
4664 
4665 
4666 
4667 
4668 
4669 
4670   if ((*__errno_location ()) == 12 && resultp !is null &&
4671       ioc != ZFS_IOC_CHANNEL_PROGRAM) {
4672    free(cast(void *)cast(uint*)zc.zc_nvlist_dst);
4673    zc.zc_nvlist_dst_size *= 2;
4674    zc.zc_nvlist_dst = cast(ulong)cast(uint*)malloc(zc.zc_nvlist_dst_size);
4675    if (zc.zc_nvlist_dst == 0UL) {
4676     error = 12;
4677     goto out_;
4678    }
4679   } else {
4680    error = (*__errno_location ());
4681    break;
4682   }
4683  }
4684  if (zc.zc_nvlist_dst_filled) {
4685   *resultp = fnvlist_unpack(cast(char*)cast(uint*)zc.zc_nvlist_dst, zc.zc_nvlist_dst_size);
4686  }
4687 
4688 out_:
4689  if (packed !is null)
4690   fnvlist_pack_free(packed, size);
4691  free(cast(void *)cast(uint*)zc.zc_nvlist_dst);
4692  return (error);
4693 }
4694 string[string] datasetListNext(string name, string[string] args)
4695 {
4696  return zfsIoctl(ZFS_IOC_DATASET_LIST_NEXT,name,args);
4697 }
4698 
4699 string[string] snapshotListNext(string name, string[string] args)
4700 {
4701  return zfsIoctl(ZFS_IOC_SNAPSHOT_LIST_NEXT,name,args);
4702 }
4703 
4704 
4705 string[string] zfsInheritProperties(string name, string[string] args)
4706 {
4707  return zfsIoctl(ZFS_IOC_SNAPSHOT_LIST_NEXT,name,args);
4708 }
4709 
4710 @SILdoc(`Create a ZFS filesystem or a ZFS volume (zvol)
4711 Params:
4712  string name - name of the dataset to be created
4713  DataSetType datasetType - dataset type (either zfs for a filesystem or zvol for a volume
4714  string[string] properties - a dictionary od ZFS dataset property name-value pairs
4715  ubyte[] encryptionKey - dataset encryption key data
4716 
4717 Errors:
4718  FilesystemExists - if a dataset with the given name already exists
4719  ParentNotFound - if a parent dataset of the requested dataset does not exist
4720  PropertyInvalid - if one or more of specified properties does not exist or has an invalid type or value
4721  NameInvalid - if the name is not a valid dataset name
4722  NameTooLong - if the name is too long
4723  WrongParent - if the parent dataset of the requested dataset is not a filesystem eg zvol
4724 `)
4725 void create(string name, DatasetType dataSetType, string[string] properties = (string[string]).init, ubyte[] encryptionKey =[])
4726 {
4727  import std.format:format;
4728  auto props = getProperties(properties);
4729  scope(exit)
4730   nvlistFree(props);
4731  auto result = lzc_create(name.toCString, cast(lzc_dataset_type) dataSetType, props,encryptionKey.ptr,encryptionKey.length.to!uint_t);
4732  enforce(result==0, format!"zfs create: %s"(result));
4733 }
4734 
4735 @SILdoc(`Clone a ZFS filesystem or a ZFS volume ("zvol") from a given snapshot.
4736 Params:
4737  string name: a name of the dataset to be created.
4738  string origin: a name of the origin snapshot.
4739  string[string] properties: ZFS dataset property name-value pairs
4740 
4741 Errors:
4742  FilesystemExists: if a dataset with the given name already exists.
4743  DatasetNotFound: if either a parent dataset of the requested dataset or the origin snapshot does not exist.
4744  PropertyInvalid: if one or more of the specified properties is invalid or has an invalid type or value.
4745  FilesystemNameInvalid: if the name is not a valid dataset name.
4746  SnapshotNameInvalid: if the origin is not a valid snapshot name.
4747  NameTooLsource/symmetry/api/libzfs_core.d.tmp:6490:67: warning: missing terminating ' character
4748      NameTooLong: if the dataset name is too longor  if the dataset's origin has a snapshot that, if transferred to the dataset, would get a too long name.
4749                                                                    ^
4750 source/symmetry/api/libzfs_core.d.tmp:6493:98: warning: missing terminating ' character
4751      SnapshotExists: if the dataset already has a snapshot with the same name as one of the origin's snapshots.
4752                                                                                                   ^
4753 source/symmetry/api/libzfs_core.d.tmp:6513:38: warning: missing terminating ' character
4754      FilesystemNotFound: if the target's parent does not exist.
4755                                       ^
4756 ong: if the name or the origin name is too long.
4757  PoolsDiffer: if the clone and the origin have different pool names.
4758 Note:
4759  Because of a deficiency of the underlying C interface DatasetNotFound can mean that either a parent filesystem of the target or the origin snapshot does not exist. It is currently impossible to distinguish between the cases.
4760  lzc_hold can be used to check that the snapshot exists and ensure that it is not destroyed before cloning.
4761 `)
4762 void clone(string name, string origin, string[string] properties = (string[string]).init)
4763 {
4764  auto props = getProperties(properties);
4765  scope(exit)
4766   nvlistFree(props);
4767  auto result = lzc_clone(name.toCString,origin.toCString,props);
4768  enforce(result==0,"something went wrong");
4769 }
4770 
4771 @SILdoc(`Promotes the ZFS dataset.
4772 Params:
4773  string name: the name of the dataset to promote.
4774 
4775 Errors:
4776  NameInvalid: if the dataset name is invalid.
4777     NameTooLong: if the dataset name is too longor if the dataset's origin has a snapshot that, if transferred to the dataset, would get a too long name.
4778     NotClone: if the dataset is not a clone.
4779     FilesystemNotFound: if the dataset does not exist.
4780     SnapshotExists: if the dataset already has a snapshot with the same name as one of the origin's snapshots.
4781 `)
4782 string promote(string name)
4783 {
4784  char[16384] buf;
4785  auto result = lzc_promote(name.toCString,buf.ptr, buf.length);
4786  enforce(result==0,"something went wrong");
4787  return buf.ptr.fromCString.idup;
4788 }
4789 
4790 @SILdoc(`Rename the ZFS dataset.
4791 Params:
4792  string from: the current name of the dataset to rename.
4793  string to: the new name of the dataset.
4794 
4795 Errors:
4796     NameInvalid: if either the source or target name is invalid.
4797     NameTooLong: if either the source or target name is too long.
4798     NameTooLong: if a snapshot of the source would get a too long name after renaming.
4799     FilesystemNotFound: if the source does not exist.
4800     FilesystemNotFound: if the target's parent does not exist.
4801     FilesystemExists: if the target already exists.
4802     PoolsDiffer: if the source and target belong to different pools.
4803 `)
4804 void rename(string from, string to)
4805 {
4806  auto result = lzc_rename(from.toCString, to.toCString);
4807  enforce(result==0,"something went wrong");
4808 }
4809 
4810 @SILdoc(`Remaps the ZFS dataset.
4811 Params:
4812  string name: the name of the dataset to remap.
4813 
4814 Errors:
4815  NameInvalid: if the dataset name is invalid.
4816     NameTooLong: if the dataset name is too long.
4817     DatasetNotFound: if the dataset does not exist.
4818     FeatureNotSupported: if the pool containing the dataset does not have the *obsolete_counts* feature enabled.
4819 `)
4820 void remap(string filesystem)
4821 {
4822  auto result = lzc_remap(filesystem.toCString);
4823  enforce(result==0,"something went wrong");
4824 }
4825 
4826 @SILdoc(`Calculate a size of data referenced by snapshots in the inclusive range between the firstsnap and the lastsnap and not shared with any other datasets.
4827 
4828 Params:
4829     string firstSnap: the name of the first snapshot in the range.
4830     string lastSnap: the name of the last snapshot in the range.
4831 
4832 Returns:
4833  ulong: the calculated stream size, in bytes.
4834 
4835 Errors:
4836     SnapshotNotFound: if either of the snapshots does not exist.
4837     NameInvalid: if the name of either snapshot is invalid.
4838     NameTooLong: if the name of either snapshot is too long.
4839     SnapshotMismatch: if fromsnap is not an ancestor snapshot of snapname
4840     PoolsDiffer: if the snapshots belong to different pools.
4841 
4842 snapRangeSpace calculates total size of blocks that exist because they are referenced only by one or more snapshots in the given range but no other dataset. In other words, this is the set of blocks that were born after the snap before firstsnap, and died before the snap after the last snap. Yet another interpretation is that the result of snapRangeSpace is the size of the space that would be freed if the snapshots in the range are destroyed. If the same snapshot is given as both the firstSnap and the lastSnap then snapRangeSpace calculates space used by the snapshot.
4843 `)
4844 ulong snapRangeSpace(string firstSnap, string lastSnap)
4845 {
4846  ulong ret;
4847  auto result = lzc_snaprange_space(firstSnap.toCString, lastSnap.toCString,&ret);
4848  enforce(result>=0, "zfs error");
4849  return ret;
4850 }
4851 
4852 @SILdoc(`
4853 Forces all in-core dirty data to be written to the primary pool storage and not the ZIL.
4854 Params:
4855     string poolname: the name of the pool.
4856     bool force: whether to force uberblock update even if there is no dirty data.
4857 `)
4858 auto poolSync(string poolName, bool force)
4859 {
4860  import std.format: format;
4861  nvlist_t* outnvl;
4862  auto innvl = nvlistAlloc(0x1, 0);
4863  if (force)
4864   nvlistAddBoolean(innvl,"force");
4865  auto result = lzc_sync(poolName.toCString,innvl,&outnvl);
4866  enforce(result ==0, format!"error during pool sync: %s"(result));
4867 }
4868 
4869 @SILdoc(`Create user holds on snapshots. If there is a hold on a snapshot, the snapshot can not be destroyed. (However, it can be marked for deletion by destroySnaps{defer:true} ).
4870 Parameters:
4871     string[string] holds: the dictionary of names of the snapshots to hold mapped to the hold names.
4872     int fileDescriptor: result of opening file
4873 
4874 Returns:
4875     string[] : list of snapshots that do not exist
4876 
4877 Errors:
4878     HoldFailure: if a hold was impossible on one or more of the snapshots.
4879     BadHoldCleanupFD: if fd is not a valid file descriptor associated with /dev/zfs
4880 
4881 The snapshots must all be in the same pool.
4882 
4883 If cleanupFd is set, then when the Fd is closed (including on process termination), the holds will be released. If the system is shut down uncleanly, the holds will be released when the pool is next opened or imported. Holds for snapshots which dont exist will be skipped and have an entry added to the return value, but will not cause an overall failure. No exceptions is raised if all holds, for snapshots that existed, were succesfully created.
4884 `)
4885 void holdSnapshot(string[string] holdsMap, int cleanupFd = -1)
4886 {
4887  import std.format:format;
4888  nvlist_t* errlist;
4889  auto holds = getProperties(holdsMap);
4890  auto result = lzc_hold(holds, cleanupFd, &errlist);
4891  enforce(result ==0, format!"error during holdsnaps: %s / %s"(result,processErrorList(errlist)));
4892 }
4893 
4894 @SILdoc(`Release user holds on snapshots.
4895 If the snapshot has been marked for deferred destroy (by destroySnapshots({defer:true}), it does not have any clones, and all the user holds are removed, then the snapshot will be destroyed. The snapshots must all be in the same pool.
4896 Params:
4897     string[string] holdsMap: a map where keys are snapshot names and values are lists of hold tags to remove.
4898 Returns:
4899  an array of any snapshots that do not exist and of any tags that do not exist for existing snapshots. Such tags are qualified with a corresponding snapshot name using the following format :file:{pool}/{fs}@{snap}#{tag}
4900 Errors:
4901  HoldReleaseFailure: if one or more existing holds could not be released.
4902 Holds which failed to release because they didnt exist will have an entry added to errlist, but will not cause an overall failure. This call is success if holds was empty or all holds that existed, were successfully removed. Otherwise an exception will be raised.
4903 `)
4904 void releaseSnapshot(string[string] holdsMap)
4905 {
4906  import std.format:format;
4907  nvlist_t* errlist;
4908  auto holds = getProperties(holdsMap);
4909  auto result = lzc_release(holds, &errlist);
4910  enforce(result ==0, format!"error during unholdsnaps: %s / %s"(result,processErrorList(errlist)));
4911 }
4912 
4913 @SILdoc(`Retrieve list of *user holds* on the specified snapshot.
4914 Params:
4915  string snapName: the name of the snapshot
4916 
4917 Returns:
4918  ulong[string] holds on the snapshots along with their creation times in seconds since the epoch
4919 `)
4920 ulong[string] getHeldSnapshots(string snapName)
4921 {
4922  import std.format:format;
4923  nvlist_t* holdsp;
4924  auto result = lzc_get_holds(snapName.toCString, &holdsp);
4925  enforce(result ==0, format!"error during getHeldSnapshots: %s"(result));
4926  return holdsp.processNvlist!(ulong[string]);
4927 }
4928 
4929 enum SendFlag
4930 {
4931  largeBlock = LZC_SEND_FLAG_LARGE_BLOCK,
4932  embedData = LZC_SEND_FLAG_EMBED_DATA,
4933  compress = LZC_SEND_FLAG_COMPRESS,
4934  raw = LZC_SEND_FLAG_RAW
4935 }
4936 
4937 @SILdoc(`Generate a zfs send stream for the specified snapshot and write it to the specified file descriptor.
4938 Params:
4939     string snapname: the name of the snapshot to send.
4940     string fromsnap: if not empty the name of the starting snapshot for the incremental stream.
4941     int fileDescriptor: the file descriptor to write the send stream to.
4942     SendFlag[] flags: the flags that control what enhanced features can be used in the stream.
4943 Errors:
4944  SnapshotNotFound: if either the starting snapshot is set and does not exist, or if the ending snapshot does not exist.
4945     NameInvalid: if the name of either snapshot is invalid.
4946     NameTooLong: if the name of either snapshot is too long.
4947     SnapshotMismatch: if fromsnap is not an ancestor snapshot of snapname
4948     PoolsDiffer: if the snapshots belong to different pools.
4949     IOError: if an input / output error occurs while writing to fd
4950     UnknownStreamFeature: if the flags contain an unknown flag name.
4951 
4952 If fromsnap is empty, a full (non-incremental) stream will be sent.
4953 If fromsnap is not empty, it must be the full name of a snapshot or bookmark to send an incremental from, e.g. :file:{pool}/{fs}@{earlier_snap} or :file:{pool}/{fs}#{earlier_bmark}. The specified snapshot or bookmark must represent an earlier point in the history of snapname. It can be an earlier snapshot in the same filesystem or zvol as snapname, or it can be the origin of snapnames filesystem, or an earlier snapshot in the origin, etc. fromsnap must be strictly an earlier snapshot, specifying the same snapshot as both fromsnap and snapname is an error.
4954 
4955 If flags contains *"large_blocks"*, the stream is permitted to contain DRR_WRITE records with drr_length > 128K, and DRR_OBJECT records with drr_blksz > 128K. If flags contains *"embedded_data"*, the stream is permitted to contain DRR_WRITE_EMBEDDED records with drr_etype == BP_EMBEDDED_TYPE_DATA, which the receiving system must support (as indicated by support for the *embedded_data* feature). If flags contains *"compress"*, the stream is generated by using compressed WRITE records for blocks which are compressed on disk and in memory. If the *lz4_compress* feature is active on the sending system, then the receiving system must have that feature enabled as well. If flags contains *"raw"*, the stream is generated, for encrypted datasets, by sending data exactly as it exists on disk. This allows backups to be taken even if encryption keys are not currently loaded.
4956 
4957 note:
4958  lzc_send can actually accept a filesystem name as the snapname. In that case lzc_send acts as if a temporary snapshot was created after the start of the call and before the stream starts being produced.
4959  lzc_send does not return until all of the stream is written to fd.
4960  lzc_send does *not* close fd upon returning.
4961 `)
4962 void sendSnapshot(string snapshotName, Socket socket, SendFlag[] flags=[], string fromSnapshot="")
4963 {
4964  import std.algorithm:fold;
4965  auto lzcFlags = flags.fold!((a,b) => a| b)(cast(SendFlag)0).to!lzc_send_flags;
4966  auto result = lzc_send(snapshotName.toCString, fromSnapshot.toCString,cast(int)socket.handle,lzcFlags);
4967  enforce(result == 0, "zfs error");
4968 }
4969 
4970 @SILdoc(`Resume a previously interrupted send operation generating a zfs send stream for the specified snapshot and writing it to the specified file descriptor.
4971 Params:
4972     string snapname: the name of the snapshot to send.
4973     string fromsnap: if set the name of the starting snapshot for the incremental stream.
4974     int fd: the file descriptor to write the send stream to.
4975     SendFlag[] flags: the flags that control what enhanced features can be used in the stream.
4976     ulong resumeobj: the object number where this send stream should resume from.
4977     ulong resumeoff: the offset where this send stream should resume from.
4978 
4979 Errors:
4980     SnapshotNotFound: if either the starting snapshot is set and does not exist, or if the ending snapshot does not exist.
4981     NameInvalid: if the name of either snapshot is invalid.
4982     NameTooLong: if the name of either snapshot is too long.
4983     SnapshotMismatch: if fromsnap is not an ancestor snapshot of snapname
4984     PoolsDiffer: if the snapshots belong to different pools.
4985     IOError: if an input / output error occurs while writing to fd
4986     UnknownStreamFeature: if the flags contain an unknown flag name.
4987 
4988 note:
4989  See sendSnapshot for more information
4990 `)
4991 auto sendResume(string snapshotName, Socket socket, string fromSnapshot="", SendFlag[] flags=[], ulong resumeObj=0UL, ulong resumeOff=0UL)
4992 {
4993  import std.algorithm:fold;
4994  auto lzcFlags = flags.fold!((a,b) => a| b)(cast(SendFlag)0).to!lzc_send_flags;
4995  auto result = lzc_send_resume(snapshotName.toCString, fromSnapshot.toCString, cast(int)socket.handle, lzcFlags, resumeObj, resumeOff);
4996  enforce(result == 0, "zfs error");
4997 }
4998 
4999 @SILdoc(`
5000 "from" can be null, a snapshot, or a bookmark.
5001 
5002 If from is null, a full (non-incremental) stream will be estimated. This
5003 is calculated very efficiently.
5004 
5005 If from is a snapshot, lzc_send_space uses the deadlists attached to
5006 each snapshot to efficiently estimate the stream size.
5007 
5008 If from is a bookmark, the indirect blocks in the destination snapshot
5009 are traversed, looking for blocks with a birth time since the creation TXG of
5010 the snapshot this bookmark was created from. This will result in
5011 significantly more I/O and be less efficient than a send space estimation on
5012 an equivalent snapshot.
5013 `)
5014 auto sendSpace(string snapshotName, string from, SendFlag[] flags)
5015 {
5016  import std.algorithm:fold;
5017  auto lzcFlags = flags.fold!((a,b) => a| b)(cast(SendFlag)0).to!lzc_send_flags;
5018  ulong retSpace;
5019  auto result = lzc_send_space(snapshotName.toCString, from.toCString, lzcFlags,&retSpace);
5020  enforce(result == 0, "zfs error");
5021  return retSpace;
5022 }
5023 
5024 
5025 /+
5026 *
5027  * Linux adds ZFS_IOC_RECV_NEW for resumable and raw streams and preserves the
5028  * legacy ZFS_IOC_RECV user/kernel interface. The new interface supports all
5029  * stream options but is currently only used for resumable streams. This way
5030  * updated user space utilities will interoperate with older kernel modules.
5031  *
5032  * Non-Linux OpenZFS platforms have opted to modify the legacy interface.
5033  */
5034 int recv_impl(const char *snapname, nvlist_t *recvdprops, nvlist_t *localprops, ubyte *wkeydata, uint_t wkeylen, const char *origin, boolean_t force, boolean_t resumable, boolean_t raw, int input_fd, const dmu_replay_record *begin_record, int cleanup_fd, ulong *read_bytes, ulong *errflags, ulong *action_handle, nvlist_t **errors)
5035 
5036 +/
5037 
5038 @SILdoc(`zfs receive:
5039 The simplest receive case: receive from the specified fd, creating the specified snapshot. Apply the specified properties as "received" properties (which can be overridden by locally-set properties). If the stream is a clone, its origin snapshot must be specified by origin. The 'force' flag will cause the target filesystem to be rolled back or destroyed if necessary to receive.
5040 
5041 Return 0 on success or an (*__errno_location ()) on failure.
5042 
5043 Note: this interface does not work on dedupd streams (those with DMU_BACKUP_FEATURE_DEDUP).
5044 
5045 resumable: Like lzc_receive, but if the receive fails due to premature stream termination, the intermediate state will be preserved on disk. In this case, ECKSUM will be returned. The receive may subsequently be resumed with a resuming send stream generated by lzc_send_resume().
5046 `)
5047 void receive(string snapName, Socket socket, string origin="", bool force=false, bool raw=false, string[string] properties = (string[string]).init, bool resumable = false)
5048 {
5049  import std.format:format;
5050  auto props = getProperties(properties);
5051  scope(exit)
5052   nvlistFree(props);
5053  auto result = resumable ? lzc_receive(snapName.toCString, props,origin.toCString, force? 1:0, raw?1:0, cast(int)socket.handle) :
5054    lzc_receive_resumable(snapName.toCString, props,origin.toCString, force?1:0, raw? 1:0, cast(int)socket.handle);
5055  enforce(result == 0, format!"zfs error: %s"(result));
5056 }
5057 
5058 @SILdoc(`zfsReceiveWithHeader
5059 Like lzc_receive, but allows the caller to read the begin record and then to pass it in. That could be useful if the caller wants to derive, for example, the snapname or the origin parameters based on the information contained in the begin record.
5060 The begin record must be in its original form as read from the stream, in other words, it should not be byteswapped.
5061 
5062 The 'resumable' parameter allows to obtain the same behavior as with lzc_receive_resumable.
5063 `)
5064 void receiveWithHeader(string snapName, Socket socket, string origin="", bool force=false, bool raw=false, string[string] properties=string[string].init, bool resumable=true, dmu_replay_record* beginRecord=null)
5065 {
5066  auto props = getProperties(properties);
5067  scope(exit)
5068   nvlistFree(props);
5069  auto result = lzc_receive_with_header(snapName.toCString, props, origin.toCString, force ? 1 :0, resumable ? 1 : 0, raw ? 1 :0, cast(int)socket.handle, beginRecord);
5070  enforce(result == 0);
5071 }
5072 
5073 @SILdoc(`zfsReceiveOne
5074 Like lzc_receive, but allows the caller to pass all supported arguments and retrieve all values returned. The only additional input parameter is 'cleanup_fd' which is used to set a cleanup-on-exit file descriptor.
5075 
5076 The following parameters all provide return values. Several may be set in the failure case and will contain additional information.
5077 
5078 The 'read_bytes' value will be set to the total number of bytes read.
5079 The 'errflags' value will contain zprop_errflags_t flags which are used to describe any failures.
5080 The 'action_handle' is used to pass the handle for this guid/ds mapping. It should be set to zero on first call and will contain an updated handle on success, it should be passed in subsequent calls.
5081 The 'errors' nvlist contains an entry for each unapplied received property. Callers are responsible for freeing this nvlist.
5082 `)
5083 auto receiveOne(string snapName, Socket socket, string origin="", bool force=false, bool resumable=true, bool raw=false, string[string] properties=string[string].init, dmu_replay_record* beginRecord=null, int cleanupFileDescriptor=-1, ulong actionHandle = 0UL)
5084 {
5085  ulong readBytes;
5086  ulong errorFlags;
5087  nvlist_t* errorList;
5088  auto props = getProperties(properties);
5089  scope(exit)
5090   nvlistFree(props);
5091  auto result = lzc_receive_one(snapName.toCString, props, origin.toCString, force ? 1 : 0, resumable ? 1 :0, raw ? 1 : 0, cast(int)socket.handle, beginRecord, cleanupFileDescriptor, &readBytes, &errorFlags, &actionHandle,&errorList);
5092  enforce(result == 0);
5093  return tuple(readBytes,actionHandle,errorFlags,errorList.processErrorList);
5094 }
5095 
5096 
5097 @SILdoc(`Like lzc_receive_one, but allows the caller to pass an additional 'cmdprops' argument.
5098 
5099 The 'cmdprops' nvlist contains both override ('zfs receive -o') and
5100 exclude ('zfs receive -x') properties. Callers are responsible for freeing
5101 this nvlist
5102 `)
5103 auto receiveWithCommandProperties(string snapName, string[string] properties, string[string] commandProperties, ubyte[] keyData, string origin, bool force, bool resumable, bool raw, int inputFileDescriptor, dmu_replay_record* beginRecord, int cleanupFileDescriptor,ulong actionHandle = 0UL)
5104 {
5105  import std.format:format;
5106  ulong readBytes;
5107  ulong errorFlags;
5108  nvlist_t* errors;
5109  auto props = getProperties(properties);
5110  scope(exit)
5111   nvlistFree(props);
5112  auto cmdProps = getProperties(commandProperties);
5113  scope(exit)
5114   nvlistFree(cmdProps);
5115  auto result = lzc_receive_with_cmdprops(snapName.toCString, props, cmdProps, keyData.ptr, keyData.length.to!uint, origin.toCString, force ? 1 :0, resumable ? 1 :0, raw ? 1 : 0, inputFileDescriptor, beginRecord, cleanupFileDescriptor, &readBytes, &errorFlags, &actionHandle, &errors);
5116  enforce(result == 0, format!"zfs error %s"(result));
5117  return tuple(readBytes,actionHandle,errorFlags,errors.processErrorList);
5118 }
5119 
5120 
5121 @SILdoc(`Roll back this filesystem or volume to its most recent snapshot
5122 returns the name of the most recent snapshot. Note that the latest snapshot may change if a new one is concurrently created or the current one is destroyed. lzc_rollback_to can be used to roll back to a specific latest snapshot.`)
5123 string rollback(string fsname)
5124 {
5125  import std.format:format;
5126  char[16384] buf;
5127  auto result = lzc_rollback(fsname.toCString, buf.ptr, buf.length.to!int);
5128  enforce(result ==0, format!"libzfs_core error %s rolling back on %s"(result,fsname));
5129  return buf.ptr.fromCString.idup;
5130 }
5131 
5132 @SILdoc(`Roll back this filesystem or volume to the specified snapshot, if possible`)
5133 void rollbackTo(string fsName, string snapName)
5134 {
5135  import std.format:format;
5136  auto result = lzc_rollback_to(fsName.toCString, snapName.toCString);
5137  enforce(result == 0, format!"zfs error: %s"(result));
5138 }
5139 
5140 @SILdoc(`Creates bookmarks.
5141 
5142 The bookmarks nvlist maps from name of the bookmark (e.g. "pool/fs#bmark") to
5143 the name of the snapshot (e.g. "pool/fs@snap"). All the bookmarks and
5144 snapshots must be in the same pool.
5145 
5146 The returned results nvlist will have an entry for each bookmark that failed.
5147 The value will be the (int32) error code.
5148 
5149 The return value will be 0 if all bookmarks were created, otherwise it will
5150 be the (*__errno_location ()) of a (undetermined) bookmarks that failed.
5151 `)
5152 auto createBookmarks(string[string] bookmarks)
5153 {
5154  import std.format:format;
5155  nvlist_t* errlist;
5156  auto list = getProperties(bookmarks);
5157  scope(exit)
5158   nvlistFree(list);
5159  auto result = lzc_bookmark(list, &errlist);
5160  enforce(result == 0, format!" zfs error: %s"(result));
5161 }
5162 
5163 
5164 @SILdoc(`
5165 Retrieve bookmarks.
5166 
5167 Retrieve the list of bookmarks for the given file system. The props
5168 parameter is an nvlist of property names (with no values) that will be
5169 returned for each bookmark.
5170 
5171 The following are valid properties on bookmarks, all of which are numbers
5172 (represented as uint64 in the nvlist)
5173 
5174 "guid" - globally unique identifier of the snapshot it refers to
5175 "createtxg" - txg when the snapshot it refers to was created
5176 "creation" - timestamp when the snapshot it refers to was created
5177 
5178 The format of the returned nvlist as follows:
5179  <short name of bookmark> . {
5180     <name of property> . {
5181          "value" . uint64
5182     }
5183   }
5184 `)
5185 ulong[string][string] getBookmarks(string fsName, string[] properties)
5186 {
5187  nvlist_t* bmarks;
5188  auto props = getList(properties);
5189  scope(exit)
5190   nvlistFree(props);
5191  auto result = lzc_get_bookmarks(fsName.toStringz, props,&bmarks);
5192  enforce(result == 0, "ZFS error");
5193  return bmarks.processNvlist!(ulong[string][string]);
5194 }
5195 
5196 @SILdoc(`Destroys bookmarks
5197 
5198 The keys in the bmarks nvlist are the bookmarks to be destroyed.
5199 They must all be in the same pool. Bookmarks are specified as
5200 <fs>#<bmark>.
5201 
5202 Bookmarks that do not exist will be silently ignored.
5203 
5204 The return value will be 0 if all bookmarks that existed were destroyed.
5205 
5206 Otherwise the return value will be the (*__errno_location ()) of a (undetermined) bookmark
5207 that failed, no bookmarks will be destroyed, and the errlist will have an
5208 entry for each bookmarks that failed. The value in the errlist will be
5209 the (int32) error code.
5210 `)
5211 auto destroyBookmarks(string[] bookmarks)
5212 {
5213  nvlist_t* errlist;
5214  auto list = getList(bookmarks);
5215  scope(exit)
5216   nvlistFree(list);
5217  auto result = lzc_destroy_bookmarks(list,&errlist);
5218  enforce(result == 0, "zfs error");
5219  return 0;
5220 }
5221 
5222 @SILdoc(`Executes a channel program
5223 
5224 If this function returns 0 the channel program was successfully loaded and
5225 ran without failing. Note that individual commands the channel program ran
5226 may have failed and the channel program is responsible for reporting such
5227 errors through outnvl if they are important.
5228 
5229 This method may also return:
5230 
5231  22 The program contains syntax errors, or an invalid memory or time
5232           limit was given. No part of the channel program was executed.
5233           If caused by syntax errors, 'outnvl' contains information about the
5234           errors.
5235 
5236  44 The program was executed, but encountered a runtime error, such as
5237           calling a function with incorrect arguments, invoking the error()
5238           function directly, failing an assert() command, etc. Some portion
5239           of the channel program may have executed and committed changes.
5240           Information about the failure can be found in 'outnvl'.
5241 
5242  12 The program fully executed, but the output buffer was not large
5243           enough to store the returned value. No output is returned through
5244           'outnvl'.
5245 
5246  28 The program was terminated because it exceeded its memory usage
5247           limit. Some portion of the channel program may have executed and
5248           committed changes to disk. No output is returned through 'outnvl'.
5249 
5250  62 The program was terminated because it exceeded its Lua instruction
5251           limit. Some portion of the channel program may have executed and
5252           committed changes to disk. No output is returned through 'outnvl'.
5253 `)
5254 void executeChannelProgram(string pool, string program, string[string] parameters, ulong instrLimit = (10 * 1000 * 1000), ulong memLimit=(10 * 1024 * 1024))
5255 {
5256  import std.format: format;
5257 
5258  auto params = getProperties(parameters);
5259  scope(exit)
5260   nvlistFree(params);
5261  nvlist_t* outnvl;
5262  auto result = lzc_channel_program(pool.toCString, program.toCString, instrLimit, memLimit, params,&outnvl);
5263  enforce(result == 0, format!"zfs error: %s"(result));
5264 }
5265 
5266 @SILdoc(`Creates a checkpoint for the specified pool.
5267 
5268 If this function returns 0 the pool was successfully checkpointed.
5269 
5270 This method may also return:
5271 
5272  ZFS_ERR_CHECKPOINT_EXISTS
5273  The pool already has a checkpoint. A pools can only have one
5274     checkpoint at most, at any given time.
5275 
5276  ZFS_ERR_DISCARDING_CHECKPOINT
5277   ZFS is in the middle of discarding a checkpoint for this pool.
5278   The pool can be checkpointed again once the discard is done.
5279 
5280  ZFS_DEVRM_IN_PROGRESS
5281   A vdev is currently being removed. The pool cannot be
5282   checkpointed until the device removal is done.
5283 
5284  ZFS_VDEV_TOO_BIG
5285   One or more top-level vdevs exceed the maximum vdev size
5286   supported for this feature.
5287 `)
5288 void createCheckpoint(string pool)
5289 {
5290  import std.format:format;
5291  auto result = lzc_pool_checkpoint(pool.toCString);
5292  enforce(result == 0, format!"zfs error: %s"(result));
5293 }
5294 
5295 @SILdoc(`Discard the checkpoint from the specified pool`)
5296 void discardCheckpoint(string pool)
5297 {
5298  auto result = lzc_pool_checkpoint_discard(pool.toCString);
5299  enforce(result != ZFS_ERR_NO_CHECKPOINT, "The pool does not have a checkpoint.");
5300  enforce(result != ZFS_ERR_DISCARDING_CHECKPOINT, "ZFS is already in the middle of discarding the checkpoint.");
5301  enforce(result != ZFS_ERR_CHECKPOINT_EXISTS, "ZFS checkpoint already exists");
5302 
5303 
5304 }
5305 
5306 @SILdoc(`
5307 Executes a read-only channel program.
5308 
5309 A read-only channel program works programmatically the same way as a
5310 normal channel program executed with lzc_channel_program(). The only
5311 difference is it runs exclusively in open-context and therefore can
5312 return faster. The downside to that, is that the program cannot change
5313 on-disk state by calling functions from the zfs.sync submodule.
5314 
5315 The return values of this function (and their meaning) are exactly the
5316 same as the ones described in lzc_channel_program().
5317 `)
5318 void executeChannelProgramNoSync(string pool, string program, string[string] parameters, ulong instrLimit = (10 * 1000 * 1000), ulong memLimit=(10 * 1024 * 1024))
5319 {
5320  import std.format: format;
5321  auto params = getProperties(parameters);
5322  scope(exit)
5323   nvlistFree(params);
5324  nvlist_t* outnvl;
5325  auto result = lzc_channel_program_nosync(pool.toCString, program.toCString, instrLimit, memLimit, params, &outnvl);
5326  enforce(result == 0, format!"zfs error: %s"(result));
5327 }
5328 
5329 
5330 @SILdoc(`Load or verify encryption key on the specified dataset.
5331 Params:
5332  string fsName: the name of the dataset
5333  bool noOp: if true the encryption key will only be verified, not loaded
5334  string encryptionKey: dataset encryption key data
5335 
5336 Errors:
5337     FilesystemNotFound: if the dataset does not exist.
5338     EncryptionKeyAlreadyLoaded: if the encryption key is already loaded.
5339     EncryptionKeyInvalid: if the encryption key provided is incorrect.
5340 `)
5341 auto loadKey(string fsName, bool noOp, string encryptionKey)
5342 {
5343  import std.format:format;
5344  auto result = lzc_load_key(fsName.toCString, noOp ? 1 : 0, cast(ubyte*)encryptionKey.ptr, encryptionKey.length.to!uint);
5345  enforce(result ==0, format!"loadkey failed with %s"(result));
5346 }
5347 
5348 @SILdoc(`Unload encryption key from the specified dataset.
5349 Params:
5350  string fsName: the name of the dataset.
5351 
5352 Errors:
5353  FilesystemNotFound: if the dataset does not exist.
5354     DatasetBusy: if the encryption key is still being used. This usually occurs when the dataset is mounted.
5355     EncryptionKeyNotLoaded: if the encryption key is not currently loaded.
5356 `)
5357 void unloadKey(string fsName)
5358 {
5359  import std.format:format;
5360  auto result = lzc_unload_key(fsName.toCString);
5361  enforce(result ==0, format!"unLoadkey failed with %s"(result));
5362 }
5363 
5364 
5365 enum DCP_CMD_NEW_KEY = 0;
5366 enum DCP_CMD_INHERIT = 1;
5367 enum DCP_CMD_FORCE_NEW_KEY = 2;
5368 enum DCP_CMD_FORCE_INHERIT = 3;
5369 enum EncryptionCommand
5370 {
5371  newKey = DCP_CMD_NEW_KEY,
5372  inherit = DCP_CMD_INHERIT,
5373  forceNewKey = DCP_CMD_FORCE_NEW_KEY,
5374  forceInherit = DCP_CMD_FORCE_INHERIT,
5375 }
5376 
5377 @SILdoc(`Change encryption key on the specified dataset.
5378 Params:
5379  string fsName: the name of the dataset.
5380     EncryptionCommand cryptCommand: the encryption "command" to be executed, currently supported values are "new_key", "inherit", "force_new_key" and "force_inherit"
5381     string[string] properties: a dictionary of encryption-related property name-value pairs; only "keyformat", "keylocation" and "pbkdf2iters" are supported (empty by default).
5382     string[] encryptionKey: dataset encryption key data (empty by default).
5383 
5384 Errors:
5385     PropertyInvalid: if props contains invalid values.
5386     FilesystemNotFound: if the dataset does not exist.
5387     UnknownCryptCommand: if cryptCommand is invalid.
5388     EncryptionKeyNotLoaded: if the encryption key is not currently loaded and therefore cannot be changed.
5389 `)
5390 auto changeKey(string fsName, EncryptionCommand cryptCommand, string encryptionKey, string[string] properties = (string[string]).init)
5391 {
5392  import std.format:format;
5393  auto props = getProperties(properties);
5394  scope(exit)
5395   nvlistFree(props);
5396  auto result = lzc_change_key(fsName.toCString, cryptCommand.to!ulong, props,cast(ubyte*)encryptionKey.ptr, encryptionKey.length.to!uint);
5397  enforce(result ==0, format!"changeKey failed with %s"(result));
5398 }
5399 
5400 @SILdoc(`Reopen a pool
5401 Params:
5402     string pool: the name of the pool.
5403     bool restartScrub: whether to restart an in-progress scrub operation.
5404 Errors:
5405     PoolNotFound: if the pool does not exist
5406 `)
5407 void reopen(string pool, bool restartScrub = false)
5408 {
5409  import std.format:format;
5410  auto result = lzc_reopen(pool.toCString, restartScrub ? 1 : 0);
5411  enforce(result ==0, format!"reopen failed with %s"(result));
5412 }
5413 string zfsVersion()
5414 {
5415  import std.process: executeShell;
5416  import std.string: splitLines, startsWith, strip, join,split;
5417  import std.algorithm: filter;
5418  import std.format:format;
5419  import std.range:back;
5420 
5421  auto result = executeShell("modinfo zfs");
5422  enforce(result.status == 0, result.output);
5423  auto lines = result.output.splitLines.filter!(line => line.startsWith("version:"));
5424  return lines.front.strip.split.back;
5425 }
5426 
5427 
5428 @SILdoc(`Check if a dataset (a filesystem, or a volume, or a snapshot) with the given name exists.
5429 Params:
5430  string path: the dataset name to check
5431 
5432 Returns:
5433  true if the dataset exists, false otherwise
5434 
5435 Note:
5436  datasetExists cannot be used to check for existence of bookmarks.
5437 `)
5438 
5439 
5440 bool datasetExists(string path)
5441 {
5442  return lzc_exists(path.toCString) !=0;
5443 }
5444 
5445 @SILdoc(`Create snapshots. All snapshots must be in the same pool. Optionally snapshot properties can be set on all snapshots. Currently only user properties (prefixed with "user:") are supported. Either all snapshots are successfully created or none are created if an exception is raised.
5446 Params:
5447     snapshotNames: a list of names of snapshots to be created.
5448     string[string] properties: ZFS dataset property name-value pairs (empty by default).
5449 
5450 Errors:
5451  SnapshotFailure: if one or more snapshots could not be created.
5452 
5453 warning:
5454  The underlying implementation reports an individual, per-snapshot error only for SnapshotExists condition and *sometimes* for NameTooLong.
5455  In all other cases a single error is reported without connection to any specific snapshot name(s). This has the following implications:
5456         * if multiple error conditions are encountered only one of them is reported
5457         * unless only one snapshot is requested then it is impossible to tell how many snapshots are problematic and what they are
5458         * only if there are no other error conditions :exc:.SnapshotExists is reported for all affected snapshots
5459         * :exc:.NameTooLong can behave either in the same way as :exc:.SnapshotExists or as all other exceptions. The former is the case where the full snapshot name exceeds the maximum allowed length but the short snapshot name (after '@') is within the limit. The latter is the case when the short name alone exceeds the maximum allowed length.
5460 `)
5461 void snapshot(string[] snapshotNames, string[string] properties = (string[string]).init)
5462 {
5463  import std.format:format;
5464  import std.string: join;
5465  auto snapshots = getList(snapshotNames);
5466  scope(exit)
5467   nvlistFree(snapshots);
5468 
5469  auto props = getProperties(properties);
5470  scope(exit)
5471   nvlistFree(props);
5472 
5473  nvlist_t* errList;
5474  auto result = lzc_snapshot(snapshots, props, &errList);
5475  if (result != 0)
5476  {
5477   auto ret2 = processErrorList(errList);
5478   enforce(ret2.length ==0, format!" failed libzfs_core snapshot: %s, %s"(snapshotNames,ret2.join(",")));
5479  }
5480 }
5481 
5482 @SILdoc(`Destroy snapshots. They must all be in the same pool. Snapshots that do not exist will be silently ignored.
5483 
5484 If defer is not set, and a snapshot has user holds or clones, the destroy operation will fail and none of the snapshots will be destroyed. If defer is set, and a snapshot has user holds or clones, it will be marked for deferred destruction, and will be destroyed when the last hold or clone is removed/destroyed. The operation succeeds if all snapshots were destroyed (or marked for later destruction if defer is set) or didnt exist to begin with.
5485 
5486 Params:
5487  string[] snapshotNames: a list of names of snapshots to be destroyed.
5488     bool defer: whether to mark busy snapshots for deferred destruction rather than immediately failing.
5489 
5490 Errors:
5491     SnapshotDestructionFailure: if one or more snapshots could not be created.
5492 
5493 note:
5494     SnapshotDestructionFailure is a compound exception that provides at least one detailed error object in SnapshotDestructionFailure.errors list. Typical error is SnapshotIsCloned if defer is False. The snapshot names are validated quite loosely and invalid names are typically ignored as nonexisiting snapshots. A snapshot name referring to a filesystem that doesnt exist is ignored. However, non-existent pool name causes PoolNotFound.
5495 `)
5496 void destroySnapshots(string[] snapshotNames, bool deferDelete)
5497 {
5498  import std.format:format;
5499  import std.string:join;
5500  auto snapshots = getList(snapshotNames);
5501  scope(exit) nvlistFree(snapshots);
5502  nvlist_t* errList;
5503  boolean_t cdeferDelete = (deferDelete) ? 1 : 0;
5504  auto result = lzc_destroy_snaps(snapshots, cdeferDelete, &errList);
5505  if (result != 0)
5506  {
5507   auto ret2 = processErrorList(errList);
5508   enforce(ret2.length ==0, format!"failed libzfs_core snapshot: %s, %s"(snapshotNames,ret2.join(",")));
5509  }
5510 }
5511 
5512 /+
5513 @SILdoc(`Destroy the ZFS dataset.
5514 Params:
5515  string datasetName: the name of the dataset to destroy.
5516 
5517 Errors:
5518     NameInvalid: if the dataset name is invalid.
5519     NameTooLong: if the dataset name is too long.
5520     FilesystemNotFound: if the dataset does not exist.
5521 `)
5522 void destroyDataset(string datasetName)
5523 {
5524  import std.string:join;
5525  import std.format:format;
5526  nvlist_t* errList;
5527     auto result = lzc_destroy_one(datasetName.toCString,null);
5528  if (result != 0)
5529  {
5530   auto ret2 = processErrorList(errList);
5531   enforce(ret2.length ==0, format!"failed libzfs_core snapshot: %s, %s"(datasetName,ret2.join(",")));
5532  }
5533 }
5534 +/
5535 
5536 @SILdoc(`Inherit properties from a parent dataset of the given ZFS dataset.
5537 Params:
5538  string name: the name of the dataset.
5539  string prop: the name of the property to inherit.
5540 
5541 Errors:
5542  NameInvalid: if the dataset name is invalid.
5543  NameTooLong: if the dataset name is too long.
5544  DatasetNotFound: if the dataset does not exist.
5545  PropertyInvalid: if one or more of the specified properties is invalid or has an invalid type or value.
5546 
5547 Inheriting a property actually resets it to its default value or removes it if its a user property, so that the property could be inherited if its inheritable. If the property is not inheritable then it would just have its default value. This function can be used on snapshots to inherit user defined properties.
5548 `)
5549 void inheritProperties(string name, string property, bool recursive=false, bool useSudo = true)
5550 {
5551  import std.algorithm:each,map;
5552  import std.format:format;
5553  import std.string:join,splitLines,split;
5554  import std.array:Appender;
5555  Appender!string props;
5556  import std.format:format;
5557  import std.process: executeShell;
5558 
5559  DatasetPropertiesResult ret;
5560  auto commandString = format!"%s inherit %s %s %s"(useSudo ? "sudo ":"", recursive ? "-r ":"", property,name);
5561  auto result = executeShell(commandString);
5562  enforce(result.status==0, result.output);
5563 }
5564 
5565 @SILdoc(`Set properties of the ZFS dataset.
5566 Params:
5567  string name: the name of the dataset.
5568  string[string]: properties
5569 
5570 Errors:
5571  NameInvalid: if the dataset name is invalid.
5572  NameTooLong: if the dataset name is too long.
5573  DatasetNotFound: if the dataset does not exist.
5574  NoSpace: if the property controls a quota and the values is too small for that quota.
5575  PropertyInvalid: if one or more of the specified properties is invalid or has an invalid type or value.
5576     This function can be used on snapshots to set user defined properties.
5577 
5578 note:
5579  An attempt to set a readonly / statistic property is ignored without reporting any error.
5580 `)
5581 
5582 
5583 
5584 void setDatasetProperties(string name, string[string] properties, bool useSudo = true)
5585 {
5586  import std.format:format;
5587  import std.string:join;
5588  import std.array:Appender;
5589  import std.process: executeShell;
5590  Appender!string props;
5591  foreach(prop;properties.byKeyValue)
5592  {
5593   props.put(prop.key);
5594   props.put("=");
5595   props.put(prop.value);
5596   props.put(" ");
5597  }
5598  auto commandString = format!"%s zfs set %s %s"(useSudo ? "sudo ":"", props.data, name);
5599  auto result = executeShell(commandString);
5600  enforce(result.status==0, result.output);
5601 }
5602 
5603 struct PipePair
5604 {
5605  int read;
5606  int write;
5607 }
5608 
5609 @SILdoc(`List subordinate elements of the given dataset.
5610 This function can be used to list child datasets and snapshots of the given dataset. The listed elements can be filtered by their type and by their depth relative to the starting dataset. :param bytes name: the name of the dataset to be listed, could be a snapshot or a dataset.
5611 
5612 Params:
5613  options: a dict of the options that control the listing behavior.
5614 
5615 Returns:
5616  PipePair - a pair of file descriptors the first of which can be used to read the listing.
5617 
5618 Errors:
5619  DatasetNotFound: if the dataset does not exist.
5620 
5621 Two options are currently available:
5622 recurse : integer or None
5623  specifies depth of the recursive listing. If None the depth is not limited. Absence of this option means that only the given dataset is listed.
5624 type : dict of bytes:None
5625  specifies dataset types to include into the listing. Currently allowed keys are "filesystem", "volume", "snapshot". Absence of this option implies all types.
5626 
5627 The first of the returned file descriptors can be used to read the listing in a binary encounded format. The data is a series of variable sized records each starting with a fixed size header, the header is followed by a serialized nvlist. Each record describes a single element and contains the elements name as well as its properties. The file descriptor must be closed after reading from it. The second file descriptor represents a pipe end to which the kernel driver is writing information. It should not be closed until all interesting information has been read and it must be explicitly closed afterwards.
5628 `)
5629 auto listImpl(string name, string[string] options)
5630 {
5631 
5632 
5633  import core.sys.posix.unistd: pipe;
5634  import core.sys.posix.fcntl;
5635  import std.format:format;
5636 
5637  int[2] pipefd;
5638  enforce(pipe(pipefd) !=-1, "pipe error");
5639     fcntl(pipefd[0], F_SETFD, FD_CLOEXEC);
5640     fcntl(pipefd[1], F_SETFD, FD_CLOEXEC);
5641     options["fd"] = pipefd[1].to!string;
5642  auto copts = getProperties(options);
5643 /+
5644     auto result = lzc_list(name.toCString,copts);
5645     if (result == 3)
5646         return PipePair(-1,-1);
5647 
5648 +/
5649     return PipePair(pipefd[0],pipefd[1]);
5650 }
5651 
5652 
5653 struct PipeRecord
5654 {
5655  uint size;
5656  ubyte val1;
5657  ubyte err;
5658  ubyte val2;
5659  ubyte val3;
5660 }
5661 @SILdoc(`A wrapper for listImpl that hides details of working with the file descriptors and provides data in an easy to consume format.
5662 Params:
5663  string name: the name of the dataset to be listed, could be a snapshot, a volume or a filesystem.
5664     int recurse: specifies depth of the recursive listing. If -1 the depth is not limited.
5665  string[] types: specifies dataset types to include into the listing. Currently allowed keys are "filesystem", "volume", "snapshot". no types is equivalent to specifying the type of the dataset named by name.
5666 
5667 Returns:
5668  string[string][] with each dictionary each describing a single listed element.
5669 `)
5670 auto list(string name, int recurse = -1, string[] types=[])
5671 {
5672  import std.format:format;
5673  import std.algorithm:map;
5674  import std.string:join;
5675  import core.sys.posix.unistd: pipe, read, close;
5676  string[string][] ret;
5677     string[string] options;
5678 
5679 
5680 
5681     if (types.length > 0)
5682         options["type"] = types.map!(type => type.to!string).join(",");
5683     if (recurse > -1)
5684   options["recurse"] = recurse.to!string;
5685 
5686 
5687 
5688 
5689  auto pipes = listImpl(name,options);
5690  if (pipes.read == -1)
5691   return ret;
5692 
5693  scope(exit)
5694  {
5695   close(pipes.write);
5696   close(pipes.read);
5697  }
5698  while(true)
5699  {
5700   ubyte[PipeRecord.sizeof] recordBytes;
5701   auto numBytes= read(pipes.read, cast(void*) recordBytes.ptr,PipeRecord.sizeof);
5702   if (numBytes != recordBytes.length)
5703    break;
5704   auto record= cast(PipeRecord)(recordBytes);
5705   if (record.err == 3)
5706    break;
5707 
5708   if (record.size == 0)
5709    break;
5710   ubyte[] dataBytes;
5711   dataBytes.length = record.size;
5712   numBytes= read(pipes.read, cast(void*) dataBytes.ptr,record.size);
5713   enforce(numBytes == dataBytes.length);
5714   auto entry = processNvlist!(string[string])(cast(nvlist_t*)dataBytes.ptr);
5715   ret ~= entry.dup;
5716  }
5717  return ret;
5718 }
5719 
5720 struct DatasetPropertiesResult
5721 {
5722  string[string] values;
5723  string[string] sources;
5724 }
5725 
5726 @SILdoc(`Get properties of the ZFS dataset.
5727 Params:
5728  string name: the name of the dataset
5729 
5730 Errors:
5731  DatasetNotFound: if the dataset does not exist.
5732  NameInvalid: if the dataset name is invalid.
5733  NameTooLong: if the dataset name is too long.
5734 
5735 Returns:
5736  string[string] mapping the property names to their values.
5737 
5738 note:
5739 The value of clones property is a list of clone names as strings.
5740 
5741 warning:
5742  The returned dictionary does not contain entries for properties with default values. One exception is the mountpoint property for which the default value is derived from the dataset name.
5743 `)
5744 
5745 
5746 
5747 DatasetPropertiesResult[string] getDatasetProperties(string name,bool recursive = true, bool useSudo = true)
5748 {
5749  import std.algorithm:each,map;
5750  import std.format:format;
5751  import std.string:join,splitLines,split,replace;
5752  import std.array:Appender;
5753  Appender!string props;
5754  import std.format:format;
5755  import std.process: executeShell;
5756  import std.range:dropOne,front;
5757 
5758  DatasetPropertiesResult[string] ret;
5759  auto commandString = format!"%s zfs get all %s %s"(useSudo ? "sudo ":"", recursive ? "-r ":"", name);
5760  auto result = executeShell(commandString);
5761  enforce(result.status==0, result.output);
5762  auto lines = result.output.splitLines;
5763  auto colNums = lines.front.getColumns();
5764  auto results = lines.dropOne.map!(line => line.makeColumns(colNums));
5765  foreach(entry;results)
5766  {
5767   if(entry.length>2)
5768   {
5769    auto r = ret.get(entry[0],DatasetPropertiesResult.init);
5770    r.values[entry[1]] = entry[2];
5771    if(entry.length >3)
5772     r.sources[entry[1]] = entry[3];
5773    ret[entry[0]] = r;
5774   }
5775  }
5776  return ret;
5777 }
5778 
5779 @SILdoc(`List the children of the ZFS dataset.
5780 Params:
5781     string name: the name of the dataset
5782 
5783 Returns:
5784     string[]: the names of the children.
5785 
5786 Errors:
5787     NameInvalid: if the dataset name is invalid.
5788     NameTooLong: if the dataset name is too long.
5789     DatasetNotFound: if the dataset does not exist.
5790 
5791 warning:
5792  If the dataset does not exist, then the returned iterator would produce no results and no error is reported. That case is indistinguishable from the dataset having no children. An attempt to list children of a snapshot is silently ignored as well.
5793 `)
5794 
5795 string[] listChildren(string name,bool useSudo = true)
5796 {
5797  import std.format:format;
5798  import std.algorithm:each,map;
5799  import std.string:join,splitLines,split;
5800  import std.array:Appender,array;
5801  Appender!string props;
5802  import std.range:dropOne,front;
5803  import std.process: executeShell;
5804 
5805 
5806  auto commandString = format!"%s zfs list -r %s"(useSudo ? "sudo ":"", name);
5807  auto result = executeShell(commandString);
5808  enforce(result.status==0, result.output);
5809  return result.output
5810   .splitLines
5811   .dropOne
5812   .map!(line => line.split(' ').front)
5813   .array;
5814 }
5815 
5816 
5817 
5818 @SILdoc(`List the snapshots of the ZFS dataset.
5819 Params:
5820  string datasetName: the name of the dataset
5821 
5822 Returns:
5823  string[] the names of the snapshots
5824 
5825 Errors:
5826     NameInvalid: if the dataset name is invalid.
5827     NameTooLong: if the dataset name is too long.
5828     DatasetNotFound: if the dataset does not exist.
5829 
5830 warning:
5831  If the dataset does not exist, then the returned iterator would produce no results and no error is reported. That case is indistinguishable from the dataset having no snapshots. An attempt to list snapshots of a snapshot is silently ignored as well.
5832 `)
5833 string[] listSnapshots(string datasetName, bool recursive = false, bool useSudo = true)
5834 {
5835  import std.format:format;
5836  import std.algorithm:each,map;
5837  import std.string:join,splitLines,split;
5838  import std.array:Appender,array;
5839  Appender!string props;
5840  import std.range:dropOne,front;
5841  import std.process: executeShell;
5842 
5843 
5844  auto commandString = format!"%s zfs list %s -t snapshot %s"(useSudo ? "sudo ":"", recursive ? "-r ":"",datasetName);
5845  auto result = executeShell(commandString);
5846  enforce(result.status==0, result.output);
5847  return result.output
5848   .splitLines
5849   .dropOne
5850   .map!(line => line.split(' ').front)
5851   .array;
5852 }
5853 
5854 
5855 
5856 nvlist_t* nvlistAlloc(uint nvflag, int kmflag)
5857 {
5858  nvlist_t* cnvlist;
5859  auto result = nvlist_alloc(&cnvlist, nvflag, kmflag);
5860  enforce(result ==0, "failed to allocate nvlist");
5861  return cnvlist;
5862 }
5863 
5864 
5865 void nvlistFree(nvlist_t* cnvlist)
5866 {
5867  nvlist_free(cnvlist);
5868 }
5869 
5870 @SILdoc(` Destroy the ZFS dataset.
5871 Params:
5872  string name: the name of the dataset to destroy
5873 
5874 Errors:
5875     NameInvalid: if the dataset name is invalid.
5876     NameTooLong: if the dataset name is too long.
5877     FilesystemNotFound: if the dataset does not exist.
5878 `)
5879 ZfsResult destroyDataset(string name)
5880 {
5881  import std.format:format;
5882  auto result = lzc_destroy(name.toCString);
5883  return zfsResult(result==0, ZfsError.noent, format!"failed to destroy %s: %s"(name,result));
5884 }
5885 
5886 
5887 
5888 
5889 
5890 string[] processErrorList(nvlist_t* errList)
5891 {
5892  import std.format:format;
5893  string[] ret;
5894  if (isNvlistEmpty(errList)) {
5895   return ret;
5896  }
5897 
5898  scope(exit)
5899   nvlistFree(errList);
5900  int errNum;
5901  nvpair_t* elem = nextNvPair(errList);
5902  while(elem !is null)
5903  {
5904   auto s = nvpair_name(elem).fromCString.idup;
5905   nvpair_value_int32(elem, &errNum);
5906   ret ~= format!"Failed Snapshot '%s':%s"(s,errNum);
5907   elem = nvlist_next_nvpair(errList, elem);
5908  }
5909  return ret;
5910 }
5911 
5912 ulong[string] processNvlist(T)(nvlist_t* list)
5913 if (is(T==ulong[string]))
5914 {
5915  ulong[string] ret;
5916  nvpair_t* elem;
5917  nvpair_value_nvlist(elem,&list);
5918  nvpair_t* listElem = nextNvPair(list);
5919  ulong[string] dictEntry;
5920  while(listElem !is null)
5921  {
5922   auto listElemKey = nvpair_name(listElem).fromCString.idup;
5923   ulong val;
5924   nvpair_value_uint64(listElem,&val);
5925   ret[listElemKey] = val;
5926  }
5927  return ret;
5928 }
5929 
5930 
5931 ulong[string][string] processNvlist(T)(nvlist_t* bookmarks)
5932 if (is(T==ulong[string][string]))
5933 {
5934  ulong[string][string] ret;
5935  if (isNvlistEmpty(bookmarks))
5936  {
5937   return ret;
5938  }
5939  scope(exit)
5940   nvlistFree(bookmarks);
5941  nvpair_t* elem = nextNvPair(bookmarks);
5942  while(elem !is null)
5943  {
5944   auto s = nvpair_name(elem).fromCString.idup;
5945   nvlist_t* list;
5946   nvpair_value_nvlist(elem,&list);
5947   ret[s] = processNvlist!(ulong[string])(list).dup;
5948   elem = nextNvPair(bookmarks);
5949  }
5950  return ret;
5951 }
5952 
5953 string[string] processNvlist(T)(nvlist_t* list)
5954 if (is(T == string[string]))
5955 {
5956  string[string] ret;
5957  auto pair = nextNvPair(list,null);
5958  while( pair !is null)
5959  {
5960   auto name = nvpair_name(pair).fromCString.idup;
5961   char* val;
5962   auto result = nvpair_value_string(pair, &val);
5963   enforce(result ==0);
5964   ret[name] = val.fromCString.idup;
5965   pair = nvlist_next_nvpair(list,pair);
5966  }
5967  return ret;
5968 }
5969 
5970 alias asDict = processNvlist!(string[string]);
5971 
5972 nvpair_t* nextNvPair(nvlist_t* list, nvpair_t* elemArg = null)
5973 {
5974  nvpair_t* elem;
5975  if (elemArg !is null)
5976   elem = elemArg;
5977  elem = nvlist_next_nvpair(list, elem);
5978  return elem;
5979 }
5980 
5981 nvlist_t* getProperties(string[string] properties)
5982 {
5983     nvlist_t* ret = nvlistAlloc(0x1,0);
5984     foreach(entry;properties.byKeyValue)
5985     {
5986         enforce(nvlist_add_string(ret,entry.key.toCString,entry.value.toCString)==0, "allocating properties");
5987     }
5988     return ret;
5989 }
5990 
5991 nvlist_t* getList(string[] values)
5992 {
5993     nvlist_t* ret = nvlistAlloc(0x1,0);
5994     foreach(value;values)
5995     {
5996         nvlistAddBoolean(ret,value);
5997     }
5998     return ret;
5999 }
6000 
6001 
6002 
6003 void nvlistAddBoolean(nvlist_t* nvlist, string name)
6004 {
6005  import std.format:format;
6006  auto errnoResult = nvlist_add_boolean(nvlist, name.toCString);
6007  enforce(errnoResult ==0, format!"Failed to add boolean: %s"(errnoResult));
6008 }
6009 
6010 bool isNvlistEmpty(nvlist_t* cnvlist)
6011 {
6012  return (nvlist_empty(cnvlist) !=0);
6013 }
6014 
6015 
6016 
6017 
6018 
6019 
6020 @SILdoc(`Create a ZFS filesystem
6021 Params:
6022  string name - name of the dataset to be created
6023  string[string] properties - a dictionary od ZFS dataset property name-value pairs
6024  ubyte[] encryptionKey - dataset encryption key data
6025 
6026 Errors:
6027  FilesystemExists - if a dataset with the given name already exists
6028  ParentNotFound - if a parent dataset of the requested dataset does not exist
6029  PropertyInvalid - if one or more of specified properties does not exist or has an invalid type or value
6030  NameInvalid - if the name is not a valid dataset name
6031  NameTooLong - if the name is too long
6032  WrongParent - if the parent dataset of the requested dataset is not a filesystem eg zvol
6033 `)
6034 
6035 void createFileSystem(string path, string[string] properties = (string[string]).init, string encryptionKey=null)
6036 {
6037  import std.format:format;
6038  auto props = getProperties(properties);
6039  enforce(props !is null, "alloc failure for props for "~path );
6040  scope(exit)
6041   nvlistFree(props);
6042 
6043  auto cpath = path.toCString;
6044  auto result = lzc_create(cpath, LZC_DATSET_TYPE_ZFS, props,cast(ubyte*)encryptionKey.ptr,encryptionKey.length.to!uint);
6045  enforce(result ==0, format!"Failed libzfs_core create: %s"(result));
6046 }
6047 
6048 
6049 
6050 ZfsResult validate(string zpool)
6051 {
6052  import std.file:exists;
6053  import std.process:executeShell;
6054  import std.exception;
6055  import std.format:format;
6056  auto result = executeShell("modprobe zfs");
6057  enforce(result.status==0, "ZFS Kernel module not found");
6058  return zfsResult(exists("/" ~ zpool), ZfsError.noent, format!"pool %s not found"(zpool));
6059 }
6060 
6061 struct ZfsResult
6062 {
6063  ZfsError status;
6064  string message;
6065 }
6066 
6067 auto zfsResult(bool success, ZfsError status, string message)
6068 {
6069  return success ? ZfsResult(ZfsError.success,"") : ZfsResult(status,message);
6070 }
6071 
6072 
6073 @("libzfs_core")
6074 unittest
6075 {
6076  import std.stdio;
6077 
6078 
6079  auto testSnap = ["tank3/shared/kaleidic@snapfoo"];
6080  snapshot(testSnap);
6081  writeln("success creating");
6082  destroySnapshots(testSnap,false);
6083  writeln("success destroying");
6084  create("tank3/shared/foo",DatasetType.zfs);
6085  writeln("success creating tank3/shared/foo");
6086  destroy("tank3/shared/foo");
6087  writeln("success destroying tank3/shared/foo");
6088 }
6089 
6090 int[] getColumns(string header)
6091 {
6092  import std.array:Appender;
6093  import std.ascii: isWhite;
6094  Appender!(int[]) ret;
6095  if (header.length==0)
6096   return ret.data;
6097  int i = 0;
6098  bool newColumn = true;
6099  while(i<header.length)
6100  {
6101   bool isWhiteSpace = header[i].isWhite;
6102   if (!isWhiteSpace && newColumn)
6103   {
6104    ret.put(i++);
6105    newColumn = false;
6106   }
6107   else
6108   {
6109    i++;
6110    if(isWhiteSpace)
6111     newColumn = true;
6112   }
6113  }
6114  return ret.data;
6115 }
6116 
6117 string[] makeColumns(string line, int[] columns)
6118 {
6119  import std.array:Appender;
6120  import std.algorithm:min;
6121  import std.string:strip;
6122  Appender!(string[]) ret;
6123  foreach(i;1..columns.length)
6124  {
6125   auto start = columns[i-1];
6126   auto end = columns[i];
6127   if (start > line.length)
6128    break;
6129   end = min(line.length,end);
6130   ret.put(line[start..end].strip);
6131  }
6132  return ret.data;
6133 }