Skip to content

Commit 3a12831

Browse files
committed
Remove some items defined in errqueue.h from emscripten
1 parent 70fc75b commit 3a12831

File tree

3 files changed

+44
-21
lines changed

3 files changed

+44
-21
lines changed

src/unix/linux_like/android/mod.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,16 @@ s! {
208208
pub cookie: u32,
209209
pub len: u32
210210
}
211+
212+
pub struct sock_extended_err {
213+
pub ee_errno: u32,
214+
pub ee_origin: u8,
215+
pub ee_type: u8,
216+
pub ee_code: u8,
217+
pub ee_pad: u8,
218+
pub ee_info: u32,
219+
pub ee_data: u32,
220+
}
211221
}
212222

213223
s_no_extra_traits! {
@@ -2081,6 +2091,14 @@ pub const FUTEX_CLOCK_REALTIME: ::c_int = 256;
20812091
pub const FUTEX_CMD_MASK: ::c_int =
20822092
!(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME);
20832093

2094+
// linux/errqueue.h
2095+
pub const SO_EE_ORIGIN_NONE: u8 = 0;
2096+
pub const SO_EE_ORIGIN_LOCAL: u8 = 1;
2097+
pub const SO_EE_ORIGIN_ICMP: u8 = 2;
2098+
pub const SO_EE_ORIGIN_ICMP6: u8 = 3;
2099+
pub const SO_EE_ORIGIN_TXSTATUS: u8 = 4;
2100+
pub const SO_EE_ORIGIN_TIMESTAMPING: u8 = SO_EE_ORIGIN_TXSTATUS;
2101+
20842102
f! {
20852103
pub fn CMSG_NXTHDR(mhdr: *const msghdr,
20862104
cmsg: *const cmsghdr) -> *mut cmsghdr {
@@ -2140,6 +2158,10 @@ f! {
21402158
pub fn NLA_ALIGN(len: ::c_int) -> ::c_int {
21412159
return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1)
21422160
}
2161+
2162+
pub fn SO_EE_OFFENDER(ee: *const ::sock_extended_err) -> *mut ::sockaddr {
2163+
ee.offset(1) as *mut ::sockaddr
2164+
}
21432165
}
21442166

21452167
extern "C" {

src/unix/linux_like/linux/mod.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,16 @@ s! {
494494
pub rm_so: regoff_t,
495495
pub rm_eo: regoff_t,
496496
}
497+
498+
pub struct sock_extended_err {
499+
pub ee_errno: u32,
500+
pub ee_origin: u8,
501+
pub ee_type: u8,
502+
pub ee_code: u8,
503+
pub ee_pad: u8,
504+
pub ee_info: u32,
505+
pub ee_data: u32,
506+
}
497507
}
498508

499509
s_no_extra_traits! {
@@ -2540,6 +2550,14 @@ pub const REG_ERANGE: ::c_int = 11;
25402550
pub const REG_ESPACE: ::c_int = 12;
25412551
pub const REG_BADRPT: ::c_int = 13;
25422552

2553+
// linux/errqueue.h
2554+
pub const SO_EE_ORIGIN_NONE: u8 = 0;
2555+
pub const SO_EE_ORIGIN_LOCAL: u8 = 1;
2556+
pub const SO_EE_ORIGIN_ICMP: u8 = 2;
2557+
pub const SO_EE_ORIGIN_ICMP6: u8 = 3;
2558+
pub const SO_EE_ORIGIN_TXSTATUS: u8 = 4;
2559+
pub const SO_EE_ORIGIN_TIMESTAMPING: u8 = SO_EE_ORIGIN_TXSTATUS;
2560+
25432561
f! {
25442562
pub fn NLA_ALIGN(len: ::c_int) -> ::c_int {
25452563
return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1)
@@ -2640,6 +2658,10 @@ f! {
26402658
pub fn RT_LOCALADDR(flags: u32) -> bool {
26412659
(flags & RTF_ADDRCLASSMASK) == (RTF_LOCAL | RTF_INTERFACE)
26422660
}
2661+
2662+
pub fn SO_EE_OFFENDER(ee: *const ::sock_extended_err) -> *mut ::sockaddr {
2663+
ee.offset(1) as *mut ::sockaddr
2664+
}
26432665
}
26442666

26452667
extern "C" {

src/unix/linux_like/mod.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -199,16 +199,6 @@ s! {
199199
pub msg_hdr: ::msghdr,
200200
pub msg_len: ::c_uint,
201201
}
202-
203-
pub struct sock_extended_err {
204-
pub ee_errno: u32,
205-
pub ee_origin: u8,
206-
pub ee_type: u8,
207-
pub ee_code: u8,
208-
pub ee_pad: u8,
209-
pub ee_info: u32,
210-
pub ee_data: u32
211-
}
212202
}
213203

214204
s_no_extra_traits! {
@@ -1202,13 +1192,6 @@ pub const ARPHRD_IEEE802154: u16 = 804;
12021192
pub const ARPHRD_VOID: u16 = 0xFFFF;
12031193
pub const ARPHRD_NONE: u16 = 0xFFFE;
12041194

1205-
pub const SO_EE_ORIGIN_NONE: u8 = 0;
1206-
pub const SO_EE_ORIGIN_LOCAL: u8 = 1;
1207-
pub const SO_EE_ORIGIN_ICMP: u8 = 2;
1208-
pub const SO_EE_ORIGIN_ICMP6: u8 = 3;
1209-
pub const SO_EE_ORIGIN_TXSTATUS: u8 = 4;
1210-
pub const SO_EE_ORIGIN_TIMESTAMPING: u8 = SO_EE_ORIGIN_TXSTATUS;
1211-
12121195
const_fn! {
12131196
{const} fn CMSG_ALIGN(len: usize) -> usize {
12141197
len + ::mem::size_of::<usize>() - 1 & !(::mem::size_of::<usize>() - 1)
@@ -1314,10 +1297,6 @@ f! {
13141297
pub fn IPTOS_ECN(x: u8) -> u8 {
13151298
x & ::IPTOS_ECN_MASK
13161299
}
1317-
1318-
pub fn SO_EE_OFFENDER(ee: *const ::sock_extended_err) -> *mut ::sockaddr {
1319-
ee.offset(1) as *mut ::sockaddr
1320-
}
13211300
}
13221301

13231302
extern "C" {

0 commit comments

Comments
 (0)