diff --git a/changelog/2198.added.md b/changelog/2198.added.md new file mode 100644 index 0000000000..93d3c50c52 --- /dev/null +++ b/changelog/2198.added.md @@ -0,0 +1 @@ +Added `sys::sendfile` support for solaris/illumos. diff --git a/src/sys/mod.rs b/src/sys/mod.rs index 276d4760fd..122bc44b7f 100644 --- a/src/sys/mod.rs +++ b/src/sys/mod.rs @@ -124,6 +124,8 @@ feature! { target_os = "freebsd", apple_targets, target_os = "linux", + target_os = "solaris", + target_os = "illumos", ))] feature! { #![feature = "zerocopy"] diff --git a/src/sys/sendfile.rs b/src/sys/sendfile.rs index 0959db73fd..6e2e0ace90 100644 --- a/src/sys/sendfile.rs +++ b/src/sys/sendfile.rs @@ -20,8 +20,9 @@ use crate::Result; /// /// `in_fd` must support `mmap`-like operations and therefore cannot be a socket. /// -/// For more information, see [the sendfile(2) man page.](https://man7.org/linux/man-pages/man2/sendfile.2.html) -#[cfg(any(target_os = "android", target_os = "linux"))] +/// For more information, see [the sendfile(2) man page.](https://man7.org/linux/man-pages/man2/sendfile.2.html) for Linux, +/// see [the sendfile(2) man page.](https://docs.oracle.com/cd/E88353_01/html/E37843/sendfile-3c.html) for Solaris. +#[cfg(any(target_os = "android", target_os = "linux", target_os = "solaris", target_os = "illumos"))] pub fn sendfile( out_fd: F1, in_fd: F2,