@@ -67,8 +67,29 @@ pub(crate) fn tcgetattr(fd: BorrowedFd<'_>) -> io::Result<Termios> {
67
67
local_modes : LocalModes :: from_bits_retain ( termios2. c_lflag ) ,
68
68
line_discipline : termios2. c_line ,
69
69
special_codes : SpecialCodes ( Default :: default ( ) ) ,
70
+
71
+ // On PowerPC musl targets, `c_ispeed`/`c_ospeed` are named
72
+ // `__c_ispeed`/`__c_ospeed`.
73
+ #[ cfg( not( all(
74
+ target_env = "musl" ,
75
+ any( target_arch = "powerpc" , target_arch = "powerpc64" )
76
+ ) ) ) ]
70
77
input_speed : termios2. c_ispeed ,
78
+ #[ cfg( not( all(
79
+ target_env = "musl" ,
80
+ any( target_arch = "powerpc" , target_arch = "powerpc64" )
81
+ ) ) ) ]
71
82
output_speed : termios2. c_ospeed ,
83
+ #[ cfg( all(
84
+ target_env = "musl" ,
85
+ any( target_arch = "powerpc" , target_arch = "powerpc64" )
86
+ ) ) ]
87
+ input_speed : termios2. __c_ispeed ,
88
+ #[ cfg( all(
89
+ target_env = "musl" ,
90
+ any( target_arch = "powerpc" , target_arch = "powerpc64" )
91
+ ) ) ]
92
+ output_speed : termios2. __c_ospeed ,
72
93
} ;
73
94
74
95
// Copy in the control codes, since libc's `c_cc` array may have a
@@ -179,15 +200,37 @@ pub(crate) fn tcsetattr(
179
200
180
201
let output_speed = termios. output_speed ( ) ;
181
202
let input_speed = termios. input_speed ( ) ;
203
+
182
204
let mut termios2 = c:: termios2 {
183
205
c_iflag : termios. input_modes . bits ( ) ,
184
206
c_oflag : termios. output_modes . bits ( ) ,
185
207
c_cflag : termios. control_modes . bits ( ) ,
186
208
c_lflag : termios. local_modes . bits ( ) ,
187
209
c_line : termios. line_discipline ,
188
210
c_cc : Default :: default ( ) ,
211
+
212
+ // On PowerPC musl targets, `c_ispeed`/`c_ospeed` are named
213
+ // `__c_ispeed`/`__c_ospeed`.
214
+ #[ cfg( not( all(
215
+ target_env = "musl" ,
216
+ any( target_arch = "powerpc" , target_arch = "powerpc64" )
217
+ ) ) ) ]
189
218
c_ispeed : input_speed,
219
+ #[ cfg( not( all(
220
+ target_env = "musl" ,
221
+ any( target_arch = "powerpc" , target_arch = "powerpc64" )
222
+ ) ) ) ]
190
223
c_ospeed : output_speed,
224
+ #[ cfg( all(
225
+ target_env = "musl" ,
226
+ any( target_arch = "powerpc" , target_arch = "powerpc64" )
227
+ ) ) ]
228
+ __c_ispeed : input_speed,
229
+ #[ cfg( all(
230
+ target_env = "musl" ,
231
+ any( target_arch = "powerpc" , target_arch = "powerpc64" )
232
+ ) ) ]
233
+ __c_ospeed : output_speed,
191
234
} ;
192
235
193
236
// Ensure that our input and output speeds are set, as `libc`
0 commit comments