File tree Expand file tree Collapse file tree 4 files changed +25
-7
lines changed
src/unix/linux_like/linux/arch Expand file tree Collapse file tree 4 files changed +25
-7
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,6 @@ fn main() {
4444 let rustc_dep_of_std = env:: var ( "CARGO_FEATURE_RUSTC_DEP_OF_STD" ) . is_ok ( ) ;
4545 let libc_ci = env:: var ( "LIBC_CI" ) . is_ok ( ) ;
4646 let libc_check_cfg = env:: var ( "LIBC_CHECK_CFG" ) . is_ok ( ) || rustc_minor_ver >= 80 ;
47- let linux_time_bits64 = env:: var ( "RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64" ) . is_ok ( ) ;
4847
4948 // The ABI of libc used by std is backward compatible with FreeBSD 12.
5049 // The ABI of libc from crates.io is backward compatible with FreeBSD 12.
@@ -81,6 +80,8 @@ fn main() {
8180 Some ( _) | None => ( ) ,
8281 }
8382
83+ let linux_time_bits64 = env:: var ( "RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64" ) . is_ok ( ) ;
84+ println ! ( "cargo:rerun-if-env-changed=RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64" ) ;
8485 if linux_time_bits64 {
8586 set_cfg ( "linux_time_bits64" ) ;
8687 }
Original file line number Diff line number Diff line change @@ -57,13 +57,24 @@ const SO_TIMESTAMPING_OLD: c_int = 37;
5757cfg_if ! {
5858 if #[ cfg( all(
5959 linux_time_bits64,
60- any( target_arch = "arm" , target_arch = "x86" )
60+ any( target_arch = "arm" , target_arch = "x86" ) ,
61+ not( any( target_env = "musl" , target_env = "ohos" ) )
6162 ) ) ] {
6263 pub const SO_TIMESTAMP : c_int = SO_TIMESTAMP_NEW ;
6364 pub const SO_TIMESTAMPNS : c_int = SO_TIMESTAMPNS_NEW ;
6465 pub const SO_TIMESTAMPING : c_int = SO_TIMESTAMPING_NEW ;
6566 pub const SO_RCVTIMEO : c_int = SO_RCVTIMEO_NEW ;
6667 pub const SO_SNDTIMEO : c_int = SO_SNDTIMEO_NEW ;
68+ } else if #[ cfg( all(
69+ linux_time_bits64,
70+ any( target_arch = "arm" , target_arch = "x86" ) ,
71+ any( target_env = "musl" , target_env = "ohos" )
72+ ) ) ] {
73+ pub const SO_TIMESTAMP : c_int = 63 ;
74+ pub const SO_TIMESTAMPNS : c_int = 64 ;
75+ pub const SO_TIMESTAMPING : c_int = 65 ;
76+ pub const SO_RCVTIMEO : c_int = 66 ;
77+ pub const SO_SNDTIMEO : c_int = 67 ;
6778 } else {
6879 pub const SO_TIMESTAMP : c_int = SO_TIMESTAMP_OLD ;
6980 pub const SO_TIMESTAMPNS : c_int = SO_TIMESTAMPNS_OLD ;
@@ -114,6 +125,7 @@ cfg_if! {
114125 any(
115126 target_arch = "x86" ,
116127 target_arch = "x86_64" ,
128+ target_arch = "arm" ,
117129 target_arch = "aarch64" ,
118130 target_arch = "csky" ,
119131 target_arch = "loongarch64"
Original file line number Diff line number Diff line change @@ -99,8 +99,13 @@ pub const SO_BINDTOIFINDEX: c_int = 62;
9999// but CI haven't support them yet.
100100// Some related consts could be found in b32.rs and b64.rs
101101const SO_TIMESTAMP_OLD : c_int = 29 ;
102+ const SO_RCVTIMEO_NEW : c_int = 66 ;
103+ const SO_SNDTIMEO_NEW : c_int = 67 ;
102104const SO_TIMESTAMPNS_OLD : c_int = 35 ;
103105const SO_TIMESTAMPING_OLD : c_int = 37 ;
106+ const SO_TIMESTAMP_NEW : c_int = 63 ;
107+ const SO_TIMESTAMPNS_NEW : c_int = 64 ;
108+ const SO_TIMESTAMPING_NEW : c_int = 65 ;
104109cfg_if ! {
105110 if #[ cfg( linux_time_bits64) ] {
106111 pub const SO_TIMESTAMP : c_int = SO_TIMESTAMP_NEW ;
Original file line number Diff line number Diff line change @@ -94,11 +94,11 @@ pub const SO_ZEROCOPY: c_int = 60;
9494pub const SO_TXTIME : c_int = 61 ;
9595pub const SCM_TXTIME : c_int = SO_TXTIME ;
9696pub const SO_BINDTOIFINDEX : c_int = 62 ;
97- // pub const SO_TIMESTAMP_NEW: c_int = 63;
98- // pub const SO_TIMESTAMPNS_NEW: c_int = 64;
99- // pub const SO_TIMESTAMPING_NEW: c_int = 65;
100- // pub const SO_RCVTIMEO_NEW: c_int = 66;
101- // pub const SO_SNDTIMEO_NEW: c_int = 67;
97+ const SO_TIMESTAMP_NEW : c_int = 63 ;
98+ const SO_TIMESTAMPNS_NEW : c_int = 64 ;
99+ const SO_TIMESTAMPING_NEW : c_int = 65 ;
100+ const SO_RCVTIMEO_NEW : c_int = 66 ;
101+ const SO_SNDTIMEO_NEW : c_int = 67 ;
102102// pub const SO_DETACH_REUSEPORT_BPF: c_int = 68;
103103// pub const SO_PREFER_BUSY_POLL: c_int = 69;
104104// pub const SO_BUSY_POLL_BUDGET: c_int = 70;
You can’t perform that action at this time.
0 commit comments