@@ -36,10 +36,17 @@ pub const SO_RCVLOWAT: c_int = 0x1004;
36
36
// NOTE: These definitions are now being renamed with _OLD postfix,
37
37
// but CI haven't support them yet.
38
38
// 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
+ }
43
50
pub const SO_ACCEPTCONN : c_int = 0x1009 ;
44
51
pub const SO_PROTOCOL : c_int = 0x1028 ;
45
52
pub const SO_DOMAIN : c_int = 0x1029 ;
@@ -91,17 +98,25 @@ pub const SO_BINDTOIFINDEX: c_int = 62;
91
98
// NOTE: These definitions are now being renamed with _OLD postfix,
92
99
// but CI haven't support them yet.
93
100
// 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_RCVTIMEO_NEW : c_int = 66 ;
103
+ const SO_SNDTIMEO_NEW : c_int = 67 ;
104
+ const SO_TIMESTAMPNS_OLD : c_int = 35 ;
105
+ const 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 ;
109
+ cfg_if ! {
110
+ if #[ cfg( linux_time_bits64) ] {
111
+ pub const SO_TIMESTAMP : c_int = SO_TIMESTAMP_NEW ;
112
+ pub const SO_TIMESTAMPNS : c_int = SO_TIMESTAMPNS_NEW ;
113
+ pub const SO_TIMESTAMPING : c_int = SO_TIMESTAMPING_NEW ;
114
+ } else {
115
+ pub const SO_TIMESTAMP : c_int = SO_TIMESTAMP_OLD ;
116
+ pub const SO_TIMESTAMPNS : c_int = SO_TIMESTAMPNS_OLD ;
117
+ pub const SO_TIMESTAMPING : c_int = SO_TIMESTAMPING_OLD ;
118
+ }
119
+ }
105
120
// pub const SO_DETACH_REUSEPORT_BPF: c_int = 68;
106
121
// pub const SO_PREFER_BUSY_POLL: c_int = 69;
107
122
// pub const SO_BUSY_POLL_BUDGET: c_int = 70;
@@ -349,10 +364,17 @@ cfg_if! {
349
364
}
350
365
351
366
cfg_if ! {
352
- if #[ cfg(
367
+ if #[ cfg( all (
353
368
any( target_arch = "mips" , target_arch = "mips32r6" ) ,
354
- any( target_env = "gnu" , target_env = "uclibc" )
355
- ) ] {
369
+ any( target_env = "uclibc" , target_env = "gnu" ) ,
370
+ linux_time_bits64
371
+ ) ) ] {
372
+ pub const RLIM_INFINITY : crate :: rlim_t = !0 ;
373
+ } else if #[ cfg( all(
374
+ any( target_arch = "mips" , target_arch = "mips32r6" ) ,
375
+ any( target_env = "uclibc" , target_env = "gnu" ) ,
376
+ not( linux_time_bits64)
377
+ ) ) ] {
356
378
pub const RLIM_INFINITY : crate :: rlim_t = 0x7fffffff ;
357
379
}
358
380
}
0 commit comments