Merge pull request #3393 from devnexen/netbsd_build_fix

netbsd build fix proposal
This commit is contained in:
Jim Fasarakis-Hilliard
2021-10-31 13:35:59 +02:00
committed by GitHub
4 changed files with 19 additions and 4 deletions

View File

@@ -61,7 +61,7 @@ mod _socket {
#[pyattr]
use c::{AF_UNIX, SO_REUSEPORT};
#[cfg(not(target_os = "freebsd"))]
#[cfg(not(any(target_os = "freebsd", target_os = "netbsd", target_os = "openbsd")))]
#[pyattr]
use c::{AI_ADDRCONFIG, AI_ALL, AI_NUMERICHOST, AI_NUMERICSERV, AI_PASSIVE};

View File

@@ -176,8 +176,11 @@ const ERROR_CODES: &[(&str, i32)] = &[
e!(ENXIO),
e!(ECANCELED),
e!(EWOULDBLOCK),
e!(cfg(not(windows)), EOWNERDEAD),
e!(cfg(not(windows)), ENOTRECOVERABLE),
e!(cfg(not(any(windows, target_os = "netbsd"))), EOWNERDEAD),
e!(
cfg(not(any(windows, target_os = "netbsd"))),
ENOTRECOVERABLE
),
e!(cfg(windows), WSAEHOSTDOWN),
e!(cfg(windows), WSAENETDOWN),
e!(cfg(windows), WSAENOTSOCK),

View File

@@ -1004,11 +1004,18 @@ pub(super) mod _os {
fn from_stat(stat: &StatStruct, vm: &VirtualMachine) -> Self {
let (atime, mtime, ctime);
#[cfg(any(unix, windows))]
#[cfg(not(target_os = "netbsd"))]
{
atime = (stat.st_atime, stat.st_atime_nsec);
mtime = (stat.st_mtime, stat.st_mtime_nsec);
ctime = (stat.st_ctime, stat.st_ctime_nsec);
}
#[cfg(target_os = "netbsd")]
{
atime = (stat.st_atime, stat.st_atimensec);
mtime = (stat.st_mtime, stat.st_mtimensec);
ctime = (stat.st_ctime, stat.st_ctimensec);
}
#[cfg(target_os = "wasi")]
{
atime = (stat.st_atim.tv_sec, stat.st_atim.tv_nsec);

View File

@@ -97,7 +97,12 @@ pub(crate) mod _signal {
};
#[cfg(unix)]
#[cfg(not(any(target_os = "macos", target_os = "openbsd", target_os = "freebsd")))]
#[cfg(not(any(
target_os = "macos",
target_os = "openbsd",
target_os = "freebsd",
target_os = "netbsd"
)))]
#[pyattr]
pub use libc::{SIGPWR, SIGSTKFLT};