Skip to content

Commit 22cabd3

Browse files
authored
feat(driver): fallback for zerocopy ops (#755)
1 parent a745c5e commit 22cabd3

4 files changed

Lines changed: 8 additions & 10 deletions

File tree

compio-driver/src/op.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ use compio_buf::{BufResult, IntoInner, IoBuf, IoBufMut, IoVectoredBuf, SetLen};
1010
use pin_project_lite::pin_project;
1111
use socket2::{SockAddr, SockAddrStorage, socklen_t};
1212

13+
#[cfg(linux_all)]
14+
pub use crate::sys::op::Splice;
1315
pub use crate::sys::op::{
14-
Accept, Recv, RecvFrom, RecvFromVectored, RecvMsg, RecvVectored, Send, SendMsg, SendTo,
15-
SendToVectored, SendVectored,
16+
Accept, Recv, RecvFrom, RecvFromVectored, RecvMsg, RecvVectored, Send, SendMsg, SendMsgZc,
17+
SendTo, SendToVectored, SendToVectoredZc, SendToZc, SendVectored, SendVectoredZc, SendZc,
1618
};
1719
#[cfg(windows)]
1820
pub use crate::sys::op::{ConnectNamedPipe, DeviceIoControl};
@@ -26,8 +28,6 @@ pub use crate::sys::op::{
2628
pub use crate::sys::op::{
2729
ReadManaged, ReadManagedAt, ReadMulti, ReadMultiAt, RecvFromManaged, RecvManaged, RecvMulti,
2830
};
29-
#[cfg(linux_all)]
30-
pub use crate::sys::op::{SendMsgZc, SendToVectoredZc, SendToZc, SendVectoredZc, SendZc, Splice};
3131
use crate::{Extra, OwnedFd, SharedFd, TakeBuffer, sys::aio::*};
3232

3333
/// Trait to update the buffer length inside the [`BufResult`].

compio-driver/src/sys/fusion/op.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,10 @@ op!(<T: IoVectoredBufMut, S: AsFd> RecvFromVectored(fd: S, buffer: T, flags: i32
132132
op!(<T: IoVectoredBuf, S: AsFd> SendToVectored(fd: S, buffer: T, addr: SockAddr, flags: i32));
133133
op!(<S: AsFd> FileStat(fd: S));
134134
op!(<S: AsFd> PathStat(dirfd: S, path: CString, follow_symlink: bool));
135-
#[cfg(linux_all)]
136135
op!(<T: IoBuf, S: AsFd> SendZc(fd: S, buffer: T, flags: i32));
137-
#[cfg(linux_all)]
138136
op!(<T: IoVectoredBuf, S: AsFd> SendVectoredZc(fd: S, buffer: T, flags: i32));
139-
#[cfg(linux_all)]
140137
op!(<T: IoBuf, S: AsFd> SendToZc(fd: S, buffer: T, addr: SockAddr, flags: i32));
141-
#[cfg(linux_all)]
142138
op!(<T: IoVectoredBuf, S: AsFd> SendToVectoredZc(fd: S, buffer: T, addr: SockAddr, flags: i32));
143-
#[cfg(linux_all)]
144139
op!(<T: IoVectoredBuf, C: IoBuf, S: AsFd> SendMsgZc(fd: S, buffer: T, control: C, addr: Option<SockAddr>, flags: i32));
145140

146141
macro_rules! mop {

compio-driver/src/sys/iocp/op.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ use windows_sys::{
3939
core::GUID,
4040
};
4141

42+
pub use self::{
43+
Send as SendZc, SendMsg as SendMsgZc, SendTo as SendToZc, SendToVectored as SendToVectoredZc,
44+
SendVectored as SendVectoredZc,
45+
};
4246
use crate::{AsFd, AsRawFd, OpCode, OpType, RawFd, op::*, sys_slice::*, syscall};
4347

4448
#[inline]

compio-driver/src/sys/poll/op.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ use libc::{pread64 as pread, preadv64 as preadv, pwrite64 as pwrite, pwritev64 a
1717
use pin_project_lite::pin_project;
1818
use socket2::{SockAddr, SockAddrStorage, Socket as Socket2, socklen_t};
1919

20-
#[cfg(linux_all)]
2120
pub use self::{
2221
Send as SendZc, SendMsg as SendMsgZc, SendTo as SendToZc, SendToVectored as SendToVectoredZc,
2322
SendVectored as SendVectoredZc,

0 commit comments

Comments
 (0)