Skip to content

Commit dd7cce6

Browse files
authored
Update sys to linux 6.7 (#253)
1 parent 01c83bb commit dd7cce6

File tree

2 files changed

+142
-15
lines changed

2 files changed

+142
-15
lines changed

src/submit.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -509,12 +509,13 @@ impl<'a> Submitter<'a> {
509509
let flags = builder.flags.bits();
510510
let fd = builder.to_fd();
511511

512-
let arg = sys::io_uring_sync_cancel_reg {
513-
addr: user_data,
514-
fd,
515-
flags,
516-
timeout: timespec,
517-
pad: [0u64; 4],
512+
let arg = {
513+
let mut arg = sys::io_uring_sync_cancel_reg::default();
514+
arg.addr = user_data;
515+
arg.fd = fd;
516+
arg.flags = flags;
517+
arg.timeout = timespec;
518+
arg
518519
};
519520
execute(
520521
self.fd.as_raw_fd(),

src/sys/sys.rs

Lines changed: 135 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,11 @@ pub const IORING_SETUP_SQE128: u32 = 1024;
9191
pub const IORING_SETUP_CQE32: u32 = 2048;
9292
pub const IORING_SETUP_SINGLE_ISSUER: u32 = 4096;
9393
pub const IORING_SETUP_DEFER_TASKRUN: u32 = 8192;
94+
pub const IORING_SETUP_NO_MMAP: u32 = 16384;
95+
pub const IORING_SETUP_REGISTERED_FD_ONLY: u32 = 32768;
96+
pub const IORING_SETUP_NO_SQARRAY: u32 = 65536;
9497
pub const IORING_URING_CMD_FIXED: u32 = 1;
98+
pub const IORING_URING_CMD_MASK: u32 = 1;
9599
pub const IORING_FSYNC_DATASYNC: u32 = 1;
96100
pub const IORING_TIMEOUT_ABS: u32 = 1;
97101
pub const IORING_TIMEOUT_UPDATE: u32 = 2;
@@ -111,6 +115,8 @@ pub const IORING_ASYNC_CANCEL_ALL: u32 = 1;
111115
pub const IORING_ASYNC_CANCEL_FD: u32 = 2;
112116
pub const IORING_ASYNC_CANCEL_ANY: u32 = 4;
113117
pub const IORING_ASYNC_CANCEL_FD_FIXED: u32 = 8;
118+
pub const IORING_ASYNC_CANCEL_USERDATA: u32 = 16;
119+
pub const IORING_ASYNC_CANCEL_OP: u32 = 32;
114120
pub const IORING_RECVSEND_POLL_FIRST: u32 = 1;
115121
pub const IORING_RECV_MULTISHOT: u32 = 2;
116122
pub const IORING_RECVSEND_FIXED_BUF: u32 = 4;
@@ -376,6 +382,55 @@ impl Default for io_uring_sqe__bindgen_ty_1 {
376382
pub union io_uring_sqe__bindgen_ty_2 {
377383
pub addr: __u64,
378384
pub splice_off_in: __u64,
385+
pub __bindgen_anon_1: io_uring_sqe__bindgen_ty_2__bindgen_ty_1,
386+
}
387+
#[repr(C)]
388+
#[derive(Debug, Default, Copy, Clone)]
389+
pub struct io_uring_sqe__bindgen_ty_2__bindgen_ty_1 {
390+
pub level: __u32,
391+
pub optname: __u32,
392+
}
393+
#[test]
394+
fn bindgen_test_layout_io_uring_sqe__bindgen_ty_2__bindgen_ty_1() {
395+
const UNINIT: ::core::mem::MaybeUninit<io_uring_sqe__bindgen_ty_2__bindgen_ty_1> =
396+
::core::mem::MaybeUninit::uninit();
397+
let ptr = UNINIT.as_ptr();
398+
assert_eq!(
399+
::core::mem::size_of::<io_uring_sqe__bindgen_ty_2__bindgen_ty_1>(),
400+
8usize,
401+
concat!(
402+
"Size of: ",
403+
stringify!(io_uring_sqe__bindgen_ty_2__bindgen_ty_1)
404+
)
405+
);
406+
assert_eq!(
407+
::core::mem::align_of::<io_uring_sqe__bindgen_ty_2__bindgen_ty_1>(),
408+
4usize,
409+
concat!(
410+
"Alignment of ",
411+
stringify!(io_uring_sqe__bindgen_ty_2__bindgen_ty_1)
412+
)
413+
);
414+
assert_eq!(
415+
unsafe { ::core::ptr::addr_of!((*ptr).level) as usize - ptr as usize },
416+
0usize,
417+
concat!(
418+
"Offset of field: ",
419+
stringify!(io_uring_sqe__bindgen_ty_2__bindgen_ty_1),
420+
"::",
421+
stringify!(level)
422+
)
423+
);
424+
assert_eq!(
425+
unsafe { ::core::ptr::addr_of!((*ptr).optname) as usize - ptr as usize },
426+
4usize,
427+
concat!(
428+
"Offset of field: ",
429+
stringify!(io_uring_sqe__bindgen_ty_2__bindgen_ty_1),
430+
"::",
431+
stringify!(optname)
432+
)
433+
);
379434
}
380435
#[test]
381436
fn bindgen_test_layout_io_uring_sqe__bindgen_ty_2() {
@@ -444,6 +499,8 @@ pub union io_uring_sqe__bindgen_ty_3 {
444499
pub xattr_flags: __u32,
445500
pub msg_ring_flags: __u32,
446501
pub uring_cmd_flags: __u32,
502+
pub waitid_flags: __u32,
503+
pub futex_flags: __u32,
447504
}
448505
#[test]
449506
fn bindgen_test_layout_io_uring_sqe__bindgen_ty_3() {
@@ -650,6 +707,26 @@ fn bindgen_test_layout_io_uring_sqe__bindgen_ty_3() {
650707
stringify!(uring_cmd_flags)
651708
)
652709
);
710+
assert_eq!(
711+
unsafe { ::core::ptr::addr_of!((*ptr).waitid_flags) as usize - ptr as usize },
712+
0usize,
713+
concat!(
714+
"Offset of field: ",
715+
stringify!(io_uring_sqe__bindgen_ty_3),
716+
"::",
717+
stringify!(waitid_flags)
718+
)
719+
);
720+
assert_eq!(
721+
unsafe { ::core::ptr::addr_of!((*ptr).futex_flags) as usize - ptr as usize },
722+
0usize,
723+
concat!(
724+
"Offset of field: ",
725+
stringify!(io_uring_sqe__bindgen_ty_3),
726+
"::",
727+
stringify!(futex_flags)
728+
)
729+
);
653730
}
654731
impl Default for io_uring_sqe__bindgen_ty_3 {
655732
fn default() -> Self {
@@ -716,6 +793,7 @@ impl Default for io_uring_sqe__bindgen_ty_4 {
716793
pub union io_uring_sqe__bindgen_ty_5 {
717794
pub splice_fd_in: __s32,
718795
pub file_index: __u32,
796+
pub optlen: __u32,
719797
pub __bindgen_anon_1: io_uring_sqe__bindgen_ty_5__bindgen_ty_1,
720798
}
721799
#[repr(C)]
@@ -801,6 +879,16 @@ fn bindgen_test_layout_io_uring_sqe__bindgen_ty_5() {
801879
stringify!(file_index)
802880
)
803881
);
882+
assert_eq!(
883+
unsafe { ::core::ptr::addr_of!((*ptr).optlen) as usize - ptr as usize },
884+
0usize,
885+
concat!(
886+
"Offset of field: ",
887+
stringify!(io_uring_sqe__bindgen_ty_5),
888+
"::",
889+
stringify!(optlen)
890+
)
891+
);
804892
}
805893
impl Default for io_uring_sqe__bindgen_ty_5 {
806894
fn default() -> Self {
@@ -814,6 +902,7 @@ impl Default for io_uring_sqe__bindgen_ty_5 {
814902
#[repr(C)]
815903
pub struct io_uring_sqe__bindgen_ty_6 {
816904
pub __bindgen_anon_1: __BindgenUnionField<io_uring_sqe__bindgen_ty_6__bindgen_ty_1>,
905+
pub optval: __BindgenUnionField<__u64>,
817906
pub cmd: __BindgenUnionField<[__u8; 0usize]>,
818907
pub bindgen_union_field: [u64; 2usize],
819908
}
@@ -880,6 +969,16 @@ fn bindgen_test_layout_io_uring_sqe__bindgen_ty_6() {
880969
8usize,
881970
concat!("Alignment of ", stringify!(io_uring_sqe__bindgen_ty_6))
882971
);
972+
assert_eq!(
973+
unsafe { ::core::ptr::addr_of!((*ptr).optval) as usize - ptr as usize },
974+
0usize,
975+
concat!(
976+
"Offset of field: ",
977+
stringify!(io_uring_sqe__bindgen_ty_6),
978+
"::",
979+
stringify!(optval)
980+
)
981+
);
883982
assert_eq!(
884983
unsafe { ::core::ptr::addr_of!((*ptr).cmd) as usize - ptr as usize },
885984
0usize,
@@ -1051,7 +1150,12 @@ pub const IORING_OP_SOCKET: io_uring_op = 45;
10511150
pub const IORING_OP_URING_CMD: io_uring_op = 46;
10521151
pub const IORING_OP_SEND_ZC: io_uring_op = 47;
10531152
pub const IORING_OP_SENDMSG_ZC: io_uring_op = 48;
1054-
pub const IORING_OP_LAST: io_uring_op = 49;
1153+
pub const IORING_OP_READ_MULTISHOT: io_uring_op = 49;
1154+
pub const IORING_OP_WAITID: io_uring_op = 50;
1155+
pub const IORING_OP_FUTEX_WAIT: io_uring_op = 51;
1156+
pub const IORING_OP_FUTEX_WAKE: io_uring_op = 52;
1157+
pub const IORING_OP_FUTEX_WAITV: io_uring_op = 53;
1158+
pub const IORING_OP_LAST: io_uring_op = 54;
10551159
pub type io_uring_op = libc::c_uint;
10561160
pub const IORING_MSG_DATA: _bindgen_ty_5 = 0;
10571161
pub const IORING_MSG_SEND_FD: _bindgen_ty_5 = 1;
@@ -1132,7 +1236,7 @@ pub struct io_sqring_offsets {
11321236
pub dropped: __u32,
11331237
pub array: __u32,
11341238
pub resv1: __u32,
1135-
pub resv2: __u64,
1239+
pub user_addr: __u64,
11361240
}
11371241
#[test]
11381242
fn bindgen_test_layout_io_sqring_offsets() {
@@ -1229,13 +1333,13 @@ fn bindgen_test_layout_io_sqring_offsets() {
12291333
)
12301334
);
12311335
assert_eq!(
1232-
unsafe { ::core::ptr::addr_of!((*ptr).resv2) as usize - ptr as usize },
1336+
unsafe { ::core::ptr::addr_of!((*ptr).user_addr) as usize - ptr as usize },
12331337
32usize,
12341338
concat!(
12351339
"Offset of field: ",
12361340
stringify!(io_sqring_offsets),
12371341
"::",
1238-
stringify!(resv2)
1342+
stringify!(user_addr)
12391343
)
12401344
);
12411345
}
@@ -1250,7 +1354,7 @@ pub struct io_cqring_offsets {
12501354
pub cqes: __u32,
12511355
pub flags: __u32,
12521356
pub resv1: __u32,
1253-
pub resv2: __u64,
1357+
pub user_addr: __u64,
12541358
}
12551359
#[test]
12561360
fn bindgen_test_layout_io_cqring_offsets() {
@@ -1347,13 +1451,13 @@ fn bindgen_test_layout_io_cqring_offsets() {
13471451
)
13481452
);
13491453
assert_eq!(
1350-
unsafe { ::core::ptr::addr_of!((*ptr).resv2) as usize - ptr as usize },
1454+
unsafe { ::core::ptr::addr_of!((*ptr).user_addr) as usize - ptr as usize },
13511455
32usize,
13521456
concat!(
13531457
"Offset of field: ",
13541458
stringify!(io_cqring_offsets),
13551459
"::",
1356-
stringify!(resv2)
1460+
stringify!(user_addr)
13571461
)
13581462
);
13591463
}
@@ -2455,7 +2559,9 @@ pub struct io_uring_sync_cancel_reg {
24552559
pub fd: __s32,
24562560
pub flags: __u32,
24572561
pub timeout: __kernel_timespec,
2458-
pub pad: [__u64; 4usize],
2562+
pub opcode: __u8,
2563+
pub pad: [__u8; 7usize],
2564+
pub pad2: [__u64; 3usize],
24592565
}
24602566
#[test]
24612567
fn bindgen_test_layout_io_uring_sync_cancel_reg() {
@@ -2513,15 +2619,35 @@ fn bindgen_test_layout_io_uring_sync_cancel_reg() {
25132619
)
25142620
);
25152621
assert_eq!(
2516-
unsafe { ::core::ptr::addr_of!((*ptr).pad) as usize - ptr as usize },
2622+
unsafe { ::core::ptr::addr_of!((*ptr).opcode) as usize - ptr as usize },
25172623
32usize,
2624+
concat!(
2625+
"Offset of field: ",
2626+
stringify!(io_uring_sync_cancel_reg),
2627+
"::",
2628+
stringify!(opcode)
2629+
)
2630+
);
2631+
assert_eq!(
2632+
unsafe { ::core::ptr::addr_of!((*ptr).pad) as usize - ptr as usize },
2633+
33usize,
25182634
concat!(
25192635
"Offset of field: ",
25202636
stringify!(io_uring_sync_cancel_reg),
25212637
"::",
25222638
stringify!(pad)
25232639
)
25242640
);
2641+
assert_eq!(
2642+
unsafe { ::core::ptr::addr_of!((*ptr).pad2) as usize - ptr as usize },
2643+
40usize,
2644+
concat!(
2645+
"Offset of field: ",
2646+
stringify!(io_uring_sync_cancel_reg),
2647+
"::",
2648+
stringify!(pad2)
2649+
)
2650+
);
25252651
}
25262652
#[repr(C)]
25272653
#[derive(Debug, Default, Copy, Clone)]

0 commit comments

Comments
 (0)