Skip to content

Commit

Permalink
Update linux-raw-sys to 0.6 release
Browse files Browse the repository at this point in the history
This required changing fields of some structs under io_uring thus
probably braking semantic versioning.
  • Loading branch information
oherrala committed Sep 15, 2024
1 parent f6f19e0 commit c2963af
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ once_cell = { version = "1.5.2", optional = true }
# libc backend can be selected via adding `--cfg=rustix_use_libc` to
# `RUSTFLAGS` or enabling the `use-libc` cargo feature.
[target.'cfg(all(not(rustix_use_libc), not(miri), target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))'.dependencies]
linux-raw-sys = { version = "0.4.14", default-features = false, features = ["general", "errno", "ioctl", "no_std", "elf"] }
linux-raw-sys = { version = "0.6", default-features = false, features = ["general", "errno", "ioctl", "no_std", "elf"] }
libc_errno = { package = "errno", version = "0.3.8", default-features = false, optional = true }
libc = { version = "0.2.156", default-features = false, optional = true }

Expand All @@ -53,7 +53,7 @@ libc = { version = "0.2.156", default-features = false }
# Some syscalls do not have libc wrappers, such as in `io_uring`. For these,
# the libc backend uses the linux-raw-sys ABI and `libc::syscall`.
[target.'cfg(all(any(target_os = "android", target_os = "linux"), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64")))))))'.dependencies]
linux-raw-sys = { version = "0.4.14", default-features = false, features = ["general", "ioctl", "no_std"] }
linux-raw-sys = { version = "0.6", default-features = false, features = ["general", "ioctl", "no_std"] }

# For the libc backend on Windows, use the Winsock API in windows-sys.
[target.'cfg(windows)'.dependencies.windows-sys]
Expand Down
20 changes: 12 additions & 8 deletions src/io_uring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,9 @@ pub struct io_uring_sync_cancel_reg {
pub fd: i32,
pub flags: IoringAsyncCancelFlags,
pub timeout: Timespec,
pub pad: [u64; 4],
pub opcode: u8,
pub pad: [u8; 7],
pub pad2: [u64; 3],
}

impl Default for io_uring_sync_cancel_reg {
Expand All @@ -1225,7 +1227,9 @@ impl Default for io_uring_sync_cancel_reg {
tv_sec: 0,
tv_nsec: 0,
},
opcode: Default::default(),
pad: Default::default(),
pad2: Default::default(),
}
}
}
Expand Down Expand Up @@ -1291,7 +1295,7 @@ pub struct io_sqring_offsets {
pub dropped: u32,
pub array: u32,
pub resv1: u32,
pub resv2: u64,
pub user_addr: u64,
}

#[allow(missing_docs)]
Expand All @@ -1306,7 +1310,7 @@ pub struct io_cqring_offsets {
pub cqes: u32,
pub flags: u32,
pub resv1: u32,
pub resv2: u64,
pub user_addr: u64,
}

#[allow(missing_docs)]
Expand Down Expand Up @@ -1419,7 +1423,7 @@ pub struct io_uring_buf_reg {
pub ring_addr: u64,
pub ring_entries: u32,
pub bgid: u16,
pub pad: u16,
pub flags: u16,
pub resv: [u64; 3_usize],
}

Expand Down Expand Up @@ -1572,7 +1576,7 @@ mod tests {
dropped,
array,
resv1,
resv2
user_addr
);
check_struct!(
io_cqring_offsets,
Expand All @@ -1584,7 +1588,7 @@ mod tests {
cqes,
flags,
resv1,
resv2
user_addr
);
check_struct!(io_uring_recvmsg_out, namelen, controllen, payloadlen, flags);
check_struct!(io_uring_probe, last_op, ops_len, resv, resv2, ops);
Expand All @@ -1596,8 +1600,8 @@ mod tests {
check_struct!(io_uring_getevents_arg, sigmask, sigmask_sz, pad, ts);
check_struct!(iovec, iov_base, iov_len);
check_struct!(open_how, flags, mode, resolve);
check_struct!(io_uring_buf_reg, ring_addr, ring_entries, bgid, pad, resv);
check_struct!(io_uring_buf_reg, ring_addr, ring_entries, bgid, flags, resv);
check_struct!(io_uring_buf, addr, len, bid, resv);
check_struct!(io_uring_sync_cancel_reg, addr, fd, flags, timeout, pad);
check_struct!(io_uring_sync_cancel_reg, addr, fd, flags, timeout, opcode, pad, pad2);
}
}

0 comments on commit c2963af

Please sign in to comment.