@@ -67,8 +67,29 @@ pub(crate) fn tcgetattr(fd: BorrowedFd<'_>) -> io::Result<Termios> {
6767 local_modes : LocalModes :: from_bits_retain ( termios2. c_lflag ) ,
6868 line_discipline : termios2. c_line ,
6969 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+ ) ) ) ]
7077 input_speed : termios2. c_ispeed ,
78+ #[ cfg( not( all(
79+ target_env = "musl" ,
80+ any( target_arch = "powerpc" , target_arch = "powerpc64" )
81+ ) ) ) ]
7182 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 ,
7293 } ;
7394
7495 // Copy in the control codes, since libc's `c_cc` array may have a
@@ -179,15 +200,37 @@ pub(crate) fn tcsetattr(
179200
180201 let output_speed = termios. output_speed ( ) ;
181202 let input_speed = termios. input_speed ( ) ;
203+
182204 let mut termios2 = c:: termios2 {
183205 c_iflag : termios. input_modes . bits ( ) ,
184206 c_oflag : termios. output_modes . bits ( ) ,
185207 c_cflag : termios. control_modes . bits ( ) ,
186208 c_lflag : termios. local_modes . bits ( ) ,
187209 c_line : termios. line_discipline ,
188210 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+ ) ) ) ]
189218 c_ispeed : input_speed,
219+ #[ cfg( not( all(
220+ target_env = "musl" ,
221+ any( target_arch = "powerpc" , target_arch = "powerpc64" )
222+ ) ) ) ]
190223 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,
191234 } ;
192235
193236 // Ensure that our input and output speeds are set, as `libc`
0 commit comments