@@ -37,10 +37,6 @@ pub const SO_PASSCRED: ::c_int = 16;
37
37
pub const SO_PEERCRED : :: c_int = 17 ;
38
38
pub const SO_RCVLOWAT : :: c_int = 18 ;
39
39
pub const SO_SNDLOWAT : :: c_int = 19 ;
40
- pub const SO_RCVTIMEO : :: c_int = 20 ;
41
- pub const SO_SNDTIMEO : :: c_int = 21 ;
42
- // pub const SO_RCVTIMEO_OLD: ::c_int = 20;
43
- // pub const SO_SNDTIMEO_OLD: ::c_int = 21;
44
40
pub const SO_SECURITY_AUTHENTICATION : :: c_int = 22 ;
45
41
pub const SO_SECURITY_ENCRYPTION_TRANSPORT : :: c_int = 23 ;
46
42
pub const SO_SECURITY_ENCRYPTION_NETWORK : :: c_int = 24 ;
@@ -49,18 +45,41 @@ pub const SO_ATTACH_FILTER: ::c_int = 26;
49
45
pub const SO_DETACH_FILTER : :: c_int = 27 ;
50
46
pub const SO_GET_FILTER : :: c_int = SO_ATTACH_FILTER ;
51
47
pub const SO_PEERNAME : :: c_int = 28 ;
52
- pub const SO_TIMESTAMP : :: c_int = 29 ;
53
- // pub const SO_TIMESTAMP_OLD: ::c_int = 29;
48
+
49
+ cfg_if ! {
50
+ if #[ cfg( all( target_env = "gnu" ,
51
+ target_pointer_width = "32" ,
52
+ any( target_arch = "arm" , target_arch = "x86" ) ) ) ] {
53
+ pub const SO_TIMESTAMP : :: c_int = SO_TIMESTAMP_NEW ;
54
+ pub const SO_TIMESTAMP_OLD : :: c_int = 29 ;
55
+ pub const SO_TIMESTAMPNS : :: c_int = SO_TIMESTAMPNS_NEW ;
56
+ pub const SO_TIMESTAMPNS_OLD : :: c_int = 35 ;
57
+ pub const SO_TIMESTAMPING : :: c_int = SO_TIMESTAMPING_NEW ;
58
+ pub const SO_TIMESTAMPING_OLD : :: c_int = 37 ;
59
+ pub const SO_RCVTIMEO : :: c_int = SO_RCVTIMEO_NEW ;
60
+ pub const SO_SNDTIMEO : :: c_int = SO_SNDTIMEO_NEW ;
61
+ pub const SO_RCVTIMEO_OLD : :: c_int = 20 ;
62
+ pub const SO_SNDTIMEO_OLD : :: c_int = 21 ;
63
+ } else {
64
+ pub const SO_TIMESTAMP : :: c_int = 29 ;
65
+ // pub const SO_TIMESTAMP_OLD: ::c_int = 29;
66
+ pub const SO_TIMESTAMPNS : :: c_int = 35 ;
67
+ // pub const SO_TIMESTAMPNS_OLD: ::c_int = 35;
68
+ pub const SO_TIMESTAMPING : :: c_int = 37 ;
69
+ // pub const SO_TIMESTAMPING_OLD: ::c_int = 37;
70
+ pub const SO_RCVTIMEO : :: c_int = 20 ;
71
+ pub const SO_SNDTIMEO : :: c_int = 21 ;
72
+ // pub const SO_RCVTIMEO_OLD: ::c_int = 20;
73
+ // pub const SO_SNDTIMEO_OLD: ::c_int = 21;
74
+ }
75
+ }
76
+
54
77
pub const SO_ACCEPTCONN : :: c_int = 30 ;
55
78
pub const SO_PEERSEC : :: c_int = 31 ;
56
79
pub const SO_SNDBUFFORCE : :: c_int = 32 ;
57
80
pub const SO_RCVBUFFORCE : :: c_int = 33 ;
58
81
pub const SO_PASSSEC : :: c_int = 34 ;
59
- pub const SO_TIMESTAMPNS : :: c_int = 35 ;
60
- // pub const SO_TIMESTAMPNS_OLD: ::c_int = 35;
61
82
pub const SO_MARK : :: c_int = 36 ;
62
- pub const SO_TIMESTAMPING : :: c_int = 37 ;
63
- // pub const SO_TIMESTAMPING_OLD: ::c_int = 37;
64
83
pub const SO_PROTOCOL : :: c_int = 38 ;
65
84
pub const SO_DOMAIN : :: c_int = 39 ;
66
85
pub const SO_RXQ_OVFL : :: c_int = 40 ;
@@ -94,7 +113,9 @@ cfg_if! {
94
113
// But they may still not have those _OLD ones.
95
114
if #[ cfg( all( any( target_arch = "x86" ,
96
115
target_arch = "x86_64" ,
97
- target_arch = "aarch64" ) ,
116
+ target_arch = "aarch64" ,
117
+ target_arch = "arm" ,
118
+ target_arch = "i686" ) ,
98
119
not( any( target_env = "musl" , target_env = "ohos" ) ) ) ) ] {
99
120
pub const SO_TIMESTAMP_NEW : :: c_int = 63 ;
100
121
pub const SO_TIMESTAMPNS_NEW : :: c_int = 64 ;
0 commit comments