diff options
Diffstat (limited to 'opt/aardvark-dns/close_range-musl.patch')
| -rw-r--r-- | opt/aardvark-dns/close_range-musl.patch | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/opt/aardvark-dns/close_range-musl.patch b/opt/aardvark-dns/close_range-musl.patch new file mode 100644 index 0000000..e853b28 --- /dev/null +++ b/opt/aardvark-dns/close_range-musl.patch @@ -0,0 +1,16 @@ +--- a/src/main.rs ++++ b/src/main.rs +@@ -34,7 +34,13 @@ + + fn main() { + // Close all fds we inherited from our parent process, we only need stdio. ++ // musl's libc crate exposes SYS_close_range but not the safe ++ // wrapper (only defined for target_env = "gnu" upstream), so fall ++ // back to the raw syscall there. ++ #[cfg(target_env = "gnu")] + let _ = unsafe { libc::close_range(3, libc::c_uint::MAX, 0) }; ++ #[cfg(not(target_env = "gnu"))] ++ let _ = unsafe { libc::syscall(libc::SYS_close_range, 3u32, libc::c_uint::MAX, 0u32) }; + + let formatter = Formatter3164 { + facility: Facility::LOG_USER, |
