@@ -36,10 +36,17 @@ pub const SO_RCVLOWAT: c_int = 0x1004;
3636// NOTE: These definitions are now being renamed with _OLD postfix,
3737// but CI haven't support them yet.
3838// Some related consts could be found in b32.rs and b64.rs
39- pub const SO_SNDTIMEO : c_int = 0x1005 ;
40- pub const SO_RCVTIMEO : c_int = 0x1006 ;
41- // pub const SO_SNDTIMEO_OLD: c_int = 0x1005;
42- // pub const SO_RCVTIMEO_OLD: c_int = 0x1006;
39+ const SO_SNDTIMEO_OLD : c_int = 0x1005 ;
40+ const SO_RCVTIMEO_OLD : c_int = 0x1006 ;
41+ cfg_if ! {
42+ if #[ cfg( linux_time_bits64) ] {
43+ pub const SO_SNDTIMEO : c_int = SO_SNDTIMEO_NEW ;
44+ pub const SO_RCVTIMEO : c_int = SO_RCVTIMEO_NEW ;
45+ } else {
46+ pub const SO_SNDTIMEO : c_int = SO_SNDTIMEO_OLD ;
47+ pub const SO_RCVTIMEO : c_int = SO_RCVTIMEO_OLD ;
48+ }
49+ }
4350pub const SO_ACCEPTCONN : c_int = 0x1009 ;
4451pub const SO_PROTOCOL : c_int = 0x1028 ;
4552pub const SO_DOMAIN : c_int = 0x1029 ;
@@ -91,17 +98,20 @@ pub const SO_BINDTOIFINDEX: c_int = 62;
9198// NOTE: These definitions are now being renamed with _OLD postfix,
9299// but CI haven't support them yet.
93100// Some related consts could be found in b32.rs and b64.rs
94- pub const SO_TIMESTAMP : c_int = 29 ;
95- pub const SO_TIMESTAMPNS : c_int = 35 ;
96- pub const SO_TIMESTAMPING : c_int = 37 ;
97- // pub const SO_TIMESTAMP_OLD: c_int = 29;
98- // pub const SO_TIMESTAMPNS_OLD: c_int = 35;
99- // pub const SO_TIMESTAMPING_OLD: c_int = 37;
100- // pub const SO_TIMESTAMP_NEW: c_int = 63;
101- // pub const SO_TIMESTAMPNS_NEW: c_int = 64;
102- // pub const SO_TIMESTAMPING_NEW: c_int = 65;
103- // pub const SO_RCVTIMEO_NEW: c_int = 66;
104- // pub const SO_SNDTIMEO_NEW: c_int = 67;
101+ const SO_TIMESTAMP_OLD : c_int = 29 ;
102+ const SO_TIMESTAMPNS_OLD : c_int = 35 ;
103+ const SO_TIMESTAMPING_OLD : c_int = 37 ;
104+ cfg_if ! {
105+ if #[ cfg( linux_time_bits64) ] {
106+ pub const SO_TIMESTAMP : c_int = SO_TIMESTAMP_NEW ;
107+ pub const SO_TIMESTAMPNS : c_int = SO_TIMESTAMPNS_NEW ;
108+ pub const SO_TIMESTAMPING : c_int = SO_TIMESTAMPING_NEW ;
109+ } else {
110+ pub const SO_TIMESTAMP : c_int = SO_TIMESTAMP_OLD ;
111+ pub const SO_TIMESTAMPNS : c_int = SO_TIMESTAMPNS_OLD ;
112+ pub const SO_TIMESTAMPING : c_int = SO_TIMESTAMPING_OLD ;
113+ }
114+ }
105115// pub const SO_DETACH_REUSEPORT_BPF: c_int = 68;
106116// pub const SO_PREFER_BUSY_POLL: c_int = 69;
107117// pub const SO_BUSY_POLL_BUDGET: c_int = 70;
0 commit comments