uring-sys2 0.8.0

liburing bindings
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
#include "liburing.h"

extern inline int
rust_io_uring_opcode_supported(struct io_uring_probe* p, int op)
{
  return io_uring_opcode_supported(p, op);
}

extern inline void
rust_io_uring_cq_advance(struct io_uring* ring, unsigned nr)
{
  io_uring_cq_advance(ring, nr);
}

extern inline void
rust_io_uring_cqe_seen(struct io_uring* ring, struct io_uring_cqe* cqe)
{
  io_uring_cqe_seen(ring, cqe);
}

extern inline void
rust_io_uring_sqe_set_data(struct io_uring_sqe* sqe, void* data)
{
  io_uring_sqe_set_data(sqe, data);
}

extern inline void*
rust_io_uring_cqe_get_data(struct io_uring_cqe* cqe)
{
  return io_uring_cqe_get_data(cqe);
}

extern inline void
rust_io_uring_sqe_set_data64(struct io_uring_sqe* sqe, __u64 data)
{
  io_uring_sqe_set_data64(sqe, data);
}

extern inline __u64
rust_io_uring_cqe_get_data64(struct io_uring_cqe* cqe)
{
  return io_uring_cqe_get_data64(cqe);
}

extern inline void
rust_io_uring_sqe_set_flags(struct io_uring_sqe* sqe, unsigned flags)
{
  io_uring_sqe_set_flags(sqe, flags);
}

extern inline void
rust_io_uring_prep_rw(int op,
                      struct io_uring_sqe* sqe,
                      int fd,
                      const void* addr,
                      unsigned len,
                      __u64 offset)
{
  io_uring_prep_rw(op, sqe, fd, addr, len, offset);
}

extern inline void
rust_io_uring_prep_splice(struct io_uring_sqe* sqe,
                          int fd_in,
                          int64_t off_in,
                          int fd_out,
                          int64_t off_out,
                          unsigned int nbytes,
                          unsigned int splice_flags)
{
  io_uring_prep_splice(
    sqe, fd_in, off_in, fd_out, off_out, nbytes, splice_flags);
}

extern inline void
rust_io_uring_prep_tee(struct io_uring_sqe* sqe,
                       int fd_in,
                       int fd_out,
                       unsigned int nbytes,
                       unsigned int splice_flags)
{
  io_uring_prep_tee(sqe, fd_in, fd_out, nbytes, splice_flags);
}

extern inline void
rust_io_uring_prep_readv(struct io_uring_sqe* sqe,
                         int fd,
                         const struct iovec* iovecs,
                         unsigned nr_vecs,
                         off_t offset)
{
  io_uring_prep_readv(sqe, fd, iovecs, nr_vecs, offset);
}

extern inline void
rust_io_uring_prep_readv2(struct io_uring_sqe* sqe,
                          int fd,
                          const struct iovec* iovecs,
                          unsigned nr_vecs,
                          __u64 offset,
                          int flags)
{
  io_uring_prep_readv2(sqe, fd, iovecs, nr_vecs, offset, flags);
}

extern inline void
rust_io_uring_prep_read_fixed(struct io_uring_sqe* sqe,
                              int fd,
                              void* buf,
                              unsigned nbytes,
                              off_t offset,
                              int buf_index)
{
  io_uring_prep_read_fixed(sqe, fd, buf, nbytes, offset, buf_index);
}

extern inline void
rust_io_uring_prep_writev(struct io_uring_sqe* sqe,
                          int fd,
                          const struct iovec* iovecs,
                          unsigned nr_vecs,
                          off_t offset)
{
  io_uring_prep_writev(sqe, fd, iovecs, nr_vecs, offset);
}

extern inline void
rust_io_uring_prep_writev2(struct io_uring_sqe* sqe,
                           int fd,
                           const struct iovec* iovecs,
                           unsigned nr_vecs,
                           __u64 offset,
                           int flags)
{
  io_uring_prep_writev2(sqe, fd, iovecs, nr_vecs, offset, flags);
}

extern inline void
rust_io_uring_prep_write_fixed(struct io_uring_sqe* sqe,
                               int fd,
                               const void* buf,
                               unsigned nbytes,
                               off_t offset,
                               int buf_index)
{
  io_uring_prep_write_fixed(sqe, fd, buf, nbytes, offset, buf_index);
}

extern inline void
rust_io_uring_prep_recvmsg(struct io_uring_sqe* sqe,
                           int fd,
                           struct msghdr* msg,
                           unsigned flags)
{
  io_uring_prep_recvmsg(sqe, fd, msg, flags);
}

extern inline void
rust_io_uring_prep_sendmsg(struct io_uring_sqe* sqe,
                           int fd,
                           const struct msghdr* msg,
                           unsigned flags)
{
  io_uring_prep_sendmsg(sqe, fd, msg, flags);
}

extern inline void
rust_io_uring_prep_poll_add(struct io_uring_sqe* sqe, int fd, short poll_mask)
{
  io_uring_prep_poll_add(sqe, fd, poll_mask);
}

extern inline void
rust_io_uring_prep_poll_multishot(struct io_uring_sqe* sqe,
                                  int fd,
                                  short poll_mask)
{
  io_uring_prep_poll_multishot(sqe, fd, poll_mask);
}

extern inline void
rust_io_uring_prep_poll_remove(struct io_uring_sqe* sqe, __u64 user_data)
{
  io_uring_prep_poll_remove(sqe, user_data);
}

extern inline void
rust_io_uring_prep_poll_update(struct io_uring_sqe* sqe,
                               __u64 old_user_data,
                               __u64 new_user_data,
                               unsigned poll_mask,
                               unsigned flags)
{
  io_uring_prep_poll_update(
    sqe, old_user_data, new_user_data, poll_mask, flags);
}

extern inline void
rust_io_uring_prep_fsync(struct io_uring_sqe* sqe, int fd, unsigned fsync_flags)
{
  io_uring_prep_fsync(sqe, fd, fsync_flags);
}

extern inline void
rust_io_uring_prep_nop(struct io_uring_sqe* sqe)
{
  io_uring_prep_nop(sqe);
}

extern inline void
rust_io_uring_prep_timeout(struct io_uring_sqe* sqe,
                           struct __kernel_timespec* ts,
                           unsigned count,
                           unsigned flags)
{
  io_uring_prep_timeout(sqe, ts, count, flags);
}

extern inline void
rust_io_uring_prep_timeout_remove(struct io_uring_sqe* sqe,
                                  __u64 user_data,
                                  unsigned flags)
{
  io_uring_prep_timeout_remove(sqe, user_data, flags);
}

extern inline void
rust_io_uring_prep_timeout_update(struct io_uring_sqe* sqe,
                                  struct __kernel_timespec* ts,
                                  __u64 user_data,
                                  unsigned flags)
{
  io_uring_prep_timeout_update(sqe, ts, user_data, flags);
}

extern inline void
rust_io_uring_prep_accept(struct io_uring_sqe* sqe,
                          int fd,
                          struct sockaddr* addr,
                          socklen_t* addrlen,
                          int flags)
{
  io_uring_prep_accept(sqe, fd, addr, addrlen, flags);
}

extern inline void
rust_io_uring_prep_accept_direct(struct io_uring_sqe* sqe,
                                 int fd,
                                 struct sockaddr* addr,
                                 socklen_t* addrlen,
                                 int flags,
                                 unsigned file_index)
{
  io_uring_prep_accept_direct(sqe, fd, addr, addrlen, flags, file_index);
}

extern inline void
rust_io_uring_prep_cancel(struct io_uring_sqe* sqe, __u64 user_data, int flags)
{
  io_uring_prep_cancel(sqe, user_data, flags);
}

extern inline void
rust_io_uring_prep_link_timeout(struct io_uring_sqe* sqe,
                                struct __kernel_timespec* ts,
                                unsigned flags)
{
  io_uring_prep_link_timeout(sqe, ts, flags);
}

extern inline void
rust_io_uring_prep_connect(struct io_uring_sqe* sqe,
                           int fd,
                           struct sockaddr* addr,
                           socklen_t addrlen)
{
  io_uring_prep_connect(sqe, fd, addr, addrlen);
}

extern inline void
rust_io_uring_prep_files_update(struct io_uring_sqe* sqe,
                                int* fds,
                                unsigned nr_fds,
                                int offset)
{
  io_uring_prep_files_update(sqe, fds, nr_fds, offset);
}

extern inline void
rust_io_uring_prep_fallocate(struct io_uring_sqe* sqe,
                             int fd,
                             int mode,
                             off_t offset,
                             off_t len)
{
  io_uring_prep_fallocate(sqe, fd, mode, offset, len);
}

extern inline void
rust_io_uring_prep_openat(struct io_uring_sqe* sqe,
                          int dfd,
                          const char* path,
                          int flags,
                          mode_t mode)
{
  io_uring_prep_openat(sqe, dfd, path, flags, mode);
}

extern inline void
rust_io_uring_prep_openat_direct(struct io_uring_sqe* sqe,
                                 int dfd,
                                 const char* path,
                                 int flags,
                                 mode_t mode,
                                 unsigned file_index)
{
  io_uring_prep_openat_direct(sqe, dfd, path, flags, mode, file_index);
}

extern inline void
rust_io_uring_prep_close(struct io_uring_sqe* sqe, int fd)
{
  io_uring_prep_close(sqe, fd);
}

extern inline void
rust_io_uring_prep_close_direct(struct io_uring_sqe* sqe, int file_index)
{
  io_uring_prep_close_direct(sqe, file_index);
}

extern inline void
rust_io_uring_prep_read(struct io_uring_sqe* sqe,
                        int fd,
                        void* buf,
                        unsigned nbytes,
                        off_t offset)
{
  io_uring_prep_read(sqe, fd, buf, nbytes, offset);
}

extern inline void
rust_io_uring_prep_write(struct io_uring_sqe* sqe,
                         int fd,
                         const void* buf,
                         unsigned nbytes,
                         off_t offset)
{
  io_uring_prep_write(sqe, fd, buf, nbytes, offset);
}

extern inline void
rust_io_uring_prep_statx(struct io_uring_sqe* sqe,
                         int dfd,
                         const char* path,
                         int flags,
                         unsigned mask,
                         struct statx* statxbuf)
{
  io_uring_prep_statx(sqe, dfd, path, flags, mask, statxbuf);
}

extern inline void
rust_io_uring_prep_fadvise(struct io_uring_sqe* sqe,
                           int fd,
                           off_t offset,
                           off_t len,
                           int advice)
{
  io_uring_prep_fadvise(sqe, fd, offset, len, advice);
}

extern inline void
rust_io_uring_prep_madvise(struct io_uring_sqe* sqe,
                           void* addr,
                           off_t length,
                           int advice)
{
  io_uring_prep_madvise(sqe, addr, length, advice);
}

extern inline void
rust_io_uring_prep_send(struct io_uring_sqe* sqe,
                        int sockfd,
                        const void* buf,
                        size_t len,
                        int flags)
{
  io_uring_prep_send(sqe, sockfd, buf, len, flags);
}

extern inline void
rust_io_uring_prep_recv(struct io_uring_sqe* sqe,
                        int sockfd,
                        void* buf,
                        size_t len,
                        int flags)
{
  io_uring_prep_recv(sqe, sockfd, buf, len, flags);
}

extern inline void
rust_io_uring_prep_openat2(struct io_uring_sqe* sqe,
                           int dfd,
                           const char* path,
                           struct open_how* how)
{
  io_uring_prep_openat2(sqe, dfd, path, how);
}

extern inline void
rust_io_uring_prep_openat2_direct(struct io_uring_sqe* sqe,
                                  int dfd,
                                  const char* path,
                                  struct open_how* how,
                                  unsigned file_index)
{
  io_uring_prep_openat2_direct(sqe, dfd, path, how, file_index);
}

extern inline void
rust_io_uring_prep_epoll_ctl(struct io_uring_sqe* sqe,
                             int epfd,
                             int fd,
                             int op,
                             struct epoll_event* ev)
{
  io_uring_prep_epoll_ctl(sqe, epfd, fd, op, ev);
}

extern inline void
rust_io_uring_prep_provide_buffers(struct io_uring_sqe* sqe,
                                   void* addr,
                                   int len,
                                   int nr,
                                   int bgid,
                                   int bid)
{
  io_uring_prep_provide_buffers(sqe, addr, len, nr, bgid, bid);
}

extern inline void
rust_io_uring_prep_remove_buffers(struct io_uring_sqe* sqe, int nr, int bgid)
{
  io_uring_prep_remove_buffers(sqe, nr, bgid);
}

extern inline void
rust_io_uring_prep_shutdown(struct io_uring_sqe* sqe, int fd, int how)
{
  io_uring_prep_shutdown(sqe, fd, how);
}

extern inline void
rust_io_uring_prep_unlinkat(struct io_uring_sqe* sqe,
                            int dfd,
                            const char* path,
                            int flags)
{
  io_uring_prep_unlinkat(sqe, dfd, path, flags);
}

extern inline void
rust_io_uring_prep_renameat(struct io_uring_sqe* sqe,
                            int olddfd,
                            const char* oldpath,
                            int newdfd,
                            const char* newpath,
                            int flags)
{
  io_uring_prep_renameat(sqe, olddfd, oldpath, newdfd, newpath, flags);
}

extern inline void
rust_io_uring_prep_sync_file_range(struct io_uring_sqe* sqe,
                                   int fd,
                                   unsigned len,
                                   __u64 offset,
                                   int flags)
{
  io_uring_prep_sync_file_range(sqe, fd, len, offset, flags);
}

extern inline void
rust_io_uring_prep_mkdirat(struct io_uring_sqe* sqe,
                           int dfd,
                           const char* path,
                           mode_t mode)
{
  io_uring_prep_mkdirat(sqe, dfd, path, mode);
}

extern inline void
rust_io_uring_prep_symlinkat(struct io_uring_sqe* sqe,
                             const char* target,
                             int newdirfd,
                             const char* linkpath)
{
  io_uring_prep_symlinkat(sqe, target, newdirfd, linkpath);
}

extern inline void
rust_io_uring_prep_linkat(struct io_uring_sqe* sqe,
                          int olddfd,
                          const char* oldpath,
                          int newdfd,
                          const char* newpath,
                          int flags)
{
  io_uring_prep_linkat(sqe, olddfd, oldpath, newdfd, newpath, flags);
}

extern inline unsigned
rust_io_uring_sq_ready(struct io_uring* ring)
{
  return io_uring_sq_ready(ring);
}

extern inline unsigned
rust_io_uring_sq_space_left(struct io_uring* ring)
{
  return io_uring_sq_space_left(ring);
}

extern inline int
rust_io_uring_sqring_wait(struct io_uring* ring)
{
  return io_uring_sqring_wait(ring);
}

extern inline unsigned
rust_io_uring_cq_ready(struct io_uring* ring)
{
  return io_uring_cq_ready(ring);
}

extern inline bool
rust_io_uring_cq_eventfd_enabled(struct io_uring* ring)
{
  return io_uring_cq_eventfd_enabled(ring);
}

extern inline int
rust_io_uring_cq_eventfd_toggle(struct io_uring* ring, bool enabled)
{
  return io_uring_cq_eventfd_toggle(ring, enabled);
}

extern inline int
rust_io_uring_wait_cqe_nr(struct io_uring* ring,
                          struct io_uring_cqe** cqe_ptr,
                          unsigned wait_nr)
{
  return io_uring_wait_cqe_nr(ring, cqe_ptr, wait_nr);
}

extern inline int
rust_io_uring_peek_cqe(struct io_uring* ring, struct io_uring_cqe** cqe_ptr)
{
  return io_uring_peek_cqe(ring, cqe_ptr);
}

extern inline int
rust_io_uring_wait_cqe(struct io_uring* ring, struct io_uring_cqe** cqe_ptr)
{
  return io_uring_wait_cqe(ring, cqe_ptr);
}

extern inline struct io_uring_sqe*
rust_io_uring_get_sqe(struct io_uring* ring)
{
  return io_uring_get_sqe(ring);
}