@@ -37,10 +37,6 @@ pub const SO_PASSCRED: ::c_int = 16;
3737pub const SO_PEERCRED : :: c_int = 17 ;
3838pub const SO_RCVLOWAT : :: c_int = 18 ;
3939pub 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;
4440pub const SO_SECURITY_AUTHENTICATION : :: c_int = 22 ;
4541pub const SO_SECURITY_ENCRYPTION_TRANSPORT : :: c_int = 23 ;
4642pub const SO_SECURITY_ENCRYPTION_NETWORK : :: c_int = 24 ;
@@ -49,18 +45,41 @@ pub const SO_ATTACH_FILTER: ::c_int = 26;
4945pub const SO_DETACH_FILTER : :: c_int = 27 ;
5046pub const SO_GET_FILTER : :: c_int = SO_ATTACH_FILTER ;
5147pub 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+
5477pub const SO_ACCEPTCONN : :: c_int = 30 ;
5578pub const SO_PEERSEC : :: c_int = 31 ;
5679pub const SO_SNDBUFFORCE : :: c_int = 32 ;
5780pub const SO_RCVBUFFORCE : :: c_int = 33 ;
5881pub const SO_PASSSEC : :: c_int = 34 ;
59- pub const SO_TIMESTAMPNS : :: c_int = 35 ;
60- // pub const SO_TIMESTAMPNS_OLD: ::c_int = 35;
6182pub const SO_MARK : :: c_int = 36 ;
62- pub const SO_TIMESTAMPING : :: c_int = 37 ;
63- // pub const SO_TIMESTAMPING_OLD: ::c_int = 37;
6483pub const SO_PROTOCOL : :: c_int = 38 ;
6584pub const SO_DOMAIN : :: c_int = 39 ;
6685pub const SO_RXQ_OVFL : :: c_int = 40 ;
@@ -94,7 +113,9 @@ cfg_if! {
94113 // But they may still not have those _OLD ones.
95114 if #[ cfg( all( any( target_arch = "x86" ,
96115 target_arch = "x86_64" ,
97- target_arch = "aarch64" ) ,
116+ target_arch = "aarch64" ,
117+ target_arch = "arm" ,
118+ target_arch = "i686" ) ,
98119 not( any( target_env = "musl" , target_env = "ohos" ) ) ) ) ] {
99120 pub const SO_TIMESTAMP_NEW : :: c_int = 63 ;
100121 pub const SO_TIMESTAMPNS_NEW : :: c_int = 64 ;
0 commit comments