We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ca76a70 commit 06a8f6bCopy full SHA for 06a8f6b
src/system/mod.rs
@@ -120,7 +120,17 @@ fn close_range(min_fd: c_uint, max_fd: c_uint) -> io::Result<()> {
120
// - any errors while closing a specific fd will be effectively ignored
121
// - if the provided range or flags are invalid, that will be reported
122
// as an error but will not cause undefined behaviour
123
- cerr(unsafe { libc::close_range(min_fd, max_fd, 0) })?;
+ unsafe {
124
+ #[cfg(not(all(target_os = "linux", target_env = "musl")))]
125
+ cerr(libc::close_range(min_fd, max_fd, 0))?;
126
+ #[cfg(all(target_os = "linux", target_env = "musl"))]
127
+ cerr(libc::syscall(
128
+ libc::SYS_close_range,
129
+ min_fd,
130
+ max_fd,
131
+ 0 as c_uint,
132
+ ))?;
133
+ }
134
}
135
136
Ok(())
0 commit comments