From 4249c680284186e870a347770725733a2407e76a Mon Sep 17 00:00:00 2001 From: "Joshua M. Clulow" Date: Mon, 22 Nov 2021 00:54:01 -0800 Subject: [PATCH] illumos: sendfile(3EXT) is in libsendfile, not libc As per https://illumos.org/man/3EXT/sendfile a separate header and library are required to access sendfile() and sendfilev() on illumos systems. --- libc-test/build.rs | 1 + src/unix/solarish/mod.rs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/libc-test/build.rs b/libc-test/build.rs index ba5197e3..7c062624 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -781,6 +781,7 @@ fn test_solarish(target: &str) { "sys/priv.h", "sys/pset.h", "sys/resource.h", + "sys/sendfile.h", "sys/socket.h", "sys/stat.h", "sys/statvfs.h", diff --git a/src/unix/solarish/mod.rs b/src/unix/solarish/mod.rs index 2b2e120e..d0c255cb 100644 --- a/src/unix/solarish/mod.rs +++ b/src/unix/solarish/mod.rs @@ -2817,7 +2817,10 @@ extern "C" { pub fn getpflags(flags: ::c_uint) -> ::c_uint; pub fn setpflags(flags: ::c_uint, value: ::c_uint) -> ::c_int; +} +#[link(name = "sendfile")] +extern "C" { pub fn sendfile(out_fd: ::c_int, in_fd: ::c_int, off: *mut ::off_t, len: ::size_t) -> ::ssize_t; pub fn sendfilev(