Skip to content

Commit 0674d90

Browse files
committed
Fixed network implementations
1 parent 616d1ea commit 0674d90

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/unix/newlib/horizon/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub type sbintime_t = ::c_longlong;
2424
s! {
2525
pub struct sockaddr {
2626
pub sa_family: ::sa_family_t,
27-
pub sa_data: [::c_char; 14],
27+
pub sa_data: *const c_char,
2828
}
2929

3030
pub struct sockaddr_storage {

src/unix/newlib/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ pub type off_t = i64;
1515
pub type pthread_t = ::c_ulong;
1616
pub type pthread_key_t = ::c_uint;
1717
pub type rlim_t = u32;
18+
#[cfg(not(target_os = "horizon"))]
1819
pub type sa_family_t = u8;
20+
#[cfg(target_os = "horizon")]
21+
pub type sa_family_t = u16;
1922
pub type socklen_t = u32;
2023
pub type speed_t = u32;
2124
pub type suseconds_t = i32;
@@ -477,7 +480,10 @@ pub const SO_SNDLOWAT: ::c_int = 0x1003;
477480
pub const SO_RCVLOWAT: ::c_int = 0x1004;
478481
pub const SO_SNDTIMEO: ::c_int = 0x1005;
479482
pub const SO_RCVTIMEO: ::c_int = 0x1006;
483+
#[cfg(not(target_os = "horizon"))]
480484
pub const SO_ERROR: ::c_int = 0x1007;
485+
#[cfg(target_os = "horizon")]
486+
pub const SO_ERROR: ::c_int = 0x1009;
481487
pub const SO_TYPE: ::c_int = 0x1008;
482488

483489
pub const SOCK_CLOEXEC: ::c_int = O_CLOEXEC;
@@ -512,7 +518,10 @@ pub const TCP_KEEPIDLE: ::c_int = 256;
512518
pub const TCP_KEEPINTVL: ::c_int = 512;
513519
pub const TCP_KEEPCNT: ::c_int = 1024;
514520

521+
#[cfg(not(target_os = "horizon"))]
515522
pub const IP_TOS: ::c_int = 3;
523+
#[cfg(target_os = "horizon")]
524+
pub const IP_TOS: ::c_int = 7;
516525
pub const IP_TTL: ::c_int = 8;
517526
pub const IP_MULTICAST_IF: ::c_int = 9;
518527
pub const IP_MULTICAST_TTL: ::c_int = 10;

0 commit comments

Comments
 (0)