Skip to content

Commit

Permalink
sys::sendfile enable it on solaris based systems (#2198)
Browse files Browse the repository at this point in the history
* sys::sendfile enable it on solaris based systems

* changelog entry
  • Loading branch information
devnexen committed Nov 23, 2023
1 parent a96a31e commit a001869
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog/2198.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added `sys::sendfile` support for solaris/illumos.
2 changes: 2 additions & 0 deletions src/sys/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ feature! {
target_os = "freebsd",
apple_targets,
target_os = "linux",
target_os = "solaris",
target_os = "illumos",
))]
feature! {
#![feature = "zerocopy"]
Expand Down
5 changes: 3 additions & 2 deletions src/sys/sendfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<F1: AsFd, F2: AsFd>(
out_fd: F1,
in_fd: F2,
Expand Down

0 comments on commit a001869

Please sign in to comment.