tokio-rs / io-uring

The `io_uring` library for Rust
Apache License 2.0
1.16k stars 129 forks source link

SendZc doesn't work. #295

Closed Eugene-Usachev closed 1 month ago

Eugene-Usachev commented 1 month ago

I tried to use SendZc and got "{ code: 22, kind: InvalidInput, message: "Invalid argument" }". This is strange because when I use Send for the same task I don't get any errors. I use SendZc like fn send_zc(&mut self, fd: Fd, buf_ptr: *const u8, len: usize, data: u64) { self.register_entry(opcode::SendZc::new(types::Fd(fd), buf_ptr, len as _).build(), data); }

where self.register_entry just register the entry with the data.

I've read a code of the crate tests and there just SendZc is used instead of Send. Need I to set some flags or give some new guarantees?

FrankReh commented 1 month ago

Sometimes this can be caused by the kernel version. Perhaps SendZc isn't supported on the kernel you are trying. Often looking at the man page for liburing will tell you when the io_uring feature you are trying to use was introduced to the kernel.