@@ -181,6 +181,15 @@ pub struct Termios {
181181 pub local_flags : LocalFlags ,
182182 /// Control characters (see `termios.c_cc` documentation)
183183 pub control_chars : [ libc:: cc_t ; NCCS ] ,
184+ /// Line discipline (see `termios.c_line` documentation)
185+ #[ cfg( any(
186+ target_os = "linux" ,
187+ target_os = "android" ,
188+ ) ) ]
189+ pub line_discipline : libc:: cc_t ,
190+ /// Line discipline (see `termios.c_line` documentation)
191+ #[ cfg( target_os = "haiku" ) ]
192+ pub line_discipline : libc:: c_char ,
184193}
185194
186195impl Termios {
@@ -196,6 +205,14 @@ impl Termios {
196205 termios. c_cflag = self . control_flags . bits ( ) ;
197206 termios. c_lflag = self . local_flags . bits ( ) ;
198207 termios. c_cc = self . control_chars ;
208+ #[ cfg( any(
209+ target_os = "linux" ,
210+ target_os = "android" ,
211+ target_os = "haiku" ,
212+ ) ) ]
213+ {
214+ termios. c_line = self . line_discipline ;
215+ }
199216 }
200217 self . inner . borrow ( )
201218 }
@@ -214,6 +231,14 @@ impl Termios {
214231 termios. c_cflag = self . control_flags . bits ( ) ;
215232 termios. c_lflag = self . local_flags . bits ( ) ;
216233 termios. c_cc = self . control_chars ;
234+ #[ cfg( any(
235+ target_os = "linux" ,
236+ target_os = "android" ,
237+ target_os = "haiku" ,
238+ ) ) ]
239+ {
240+ termios. c_line = self . line_discipline ;
241+ }
217242 }
218243 self . inner . as_ptr ( )
219244 }
@@ -226,6 +251,14 @@ impl Termios {
226251 self . control_flags = ControlFlags :: from_bits_truncate ( termios. c_cflag ) ;
227252 self . local_flags = LocalFlags :: from_bits_truncate ( termios. c_lflag ) ;
228253 self . control_chars = termios. c_cc ;
254+ #[ cfg( any(
255+ target_os = "linux" ,
256+ target_os = "android" ,
257+ target_os = "haiku" ,
258+ ) ) ]
259+ {
260+ self . line_discipline = termios. c_line ;
261+ }
229262 }
230263}
231264
@@ -238,6 +271,12 @@ impl From<libc::termios> for Termios {
238271 control_flags : ControlFlags :: from_bits_truncate ( termios. c_cflag ) ,
239272 local_flags : LocalFlags :: from_bits_truncate ( termios. c_lflag ) ,
240273 control_chars : termios. c_cc ,
274+ #[ cfg( any(
275+ target_os = "linux" ,
276+ target_os = "android" ,
277+ target_os = "haiku" ,
278+ ) ) ]
279+ line_discipline : termios. c_line ,
241280 }
242281 }
243282}
0 commit comments