summaryrefslogtreecommitdiff
path: root/src/unix/newlib
diff options
context:
space:
mode:
authorMeziu <meziu210@icloud.com>2021-12-26 17:55:40 +0100
committerAndrea Ciliberti <meziu210@icloud.com>2022-01-23 00:45:33 +0100
commit0674d9038da6c16b017127f621c3870150ffb736 (patch)
tree4c0b83846271db62166055306a46e79717450bbb /src/unix/newlib
parent616d1ea09e79d7285104348b91b492eb4fd7badc (diff)
downloadrust-libc-0674d9038da6c16b017127f621c3870150ffb736.tar.gz
Fixed network implementations
Diffstat (limited to 'src/unix/newlib')
-rw-r--r--src/unix/newlib/horizon/mod.rs2
-rw-r--r--src/unix/newlib/mod.rs9
2 files changed, 10 insertions, 1 deletions
diff --git a/src/unix/newlib/horizon/mod.rs b/src/unix/newlib/horizon/mod.rs
index 90c0f5aff1..a1867bf0a5 100644
--- a/src/unix/newlib/horizon/mod.rs
+++ b/src/unix/newlib/horizon/mod.rs
@@ -24,7 +24,7 @@ pub type sbintime_t = ::c_longlong;
s! {
pub struct sockaddr {
pub sa_family: ::sa_family_t,
- pub sa_data: [::c_char; 14],
+ pub sa_data: *const c_char,
}
pub struct sockaddr_storage {
diff --git a/src/unix/newlib/mod.rs b/src/unix/newlib/mod.rs
index 642c13f61c..197fe395b3 100644
--- a/src/unix/newlib/mod.rs
+++ b/src/unix/newlib/mod.rs
@@ -15,7 +15,10 @@ pub type off_t = i64;
pub type pthread_t = ::c_ulong;
pub type pthread_key_t = ::c_uint;
pub type rlim_t = u32;
+#[cfg(not(target_os = "horizon"))]
pub type sa_family_t = u8;
+#[cfg(target_os = "horizon")]
+pub type sa_family_t = u16;
pub type socklen_t = u32;
pub type speed_t = u32;
pub type suseconds_t = i32;
@@ -477,7 +480,10 @@ pub const SO_SNDLOWAT: ::c_int = 0x1003;
pub const SO_RCVLOWAT: ::c_int = 0x1004;
pub const SO_SNDTIMEO: ::c_int = 0x1005;
pub const SO_RCVTIMEO: ::c_int = 0x1006;
+#[cfg(not(target_os = "horizon"))]
pub const SO_ERROR: ::c_int = 0x1007;
+#[cfg(target_os = "horizon")]
+pub const SO_ERROR: ::c_int = 0x1009;
pub const SO_TYPE: ::c_int = 0x1008;
pub const SOCK_CLOEXEC: ::c_int = O_CLOEXEC;
@@ -512,7 +518,10 @@ pub const TCP_KEEPIDLE: ::c_int = 256;
pub const TCP_KEEPINTVL: ::c_int = 512;
pub const TCP_KEEPCNT: ::c_int = 1024;
+#[cfg(not(target_os = "horizon"))]
pub const IP_TOS: ::c_int = 3;
+#[cfg(target_os = "horizon")]
+pub const IP_TOS: ::c_int = 7;
pub const IP_TTL: ::c_int = 8;
pub const IP_MULTICAST_IF: ::c_int = 9;
pub const IP_MULTICAST_TTL: ::c_int = 10;