@@ -181,6 +181,15 @@ pub struct Termios {
181
181
pub local_flags : LocalFlags ,
182
182
/// Control characters (see `termios.c_cc` documentation)
183
183
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 ,
184
193
}
185
194
186
195
impl Termios {
@@ -196,6 +205,14 @@ impl Termios {
196
205
termios. c_cflag = self . control_flags . bits ( ) ;
197
206
termios. c_lflag = self . local_flags . bits ( ) ;
198
207
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
+ }
199
216
}
200
217
self . inner . borrow ( )
201
218
}
@@ -214,6 +231,14 @@ impl Termios {
214
231
termios. c_cflag = self . control_flags . bits ( ) ;
215
232
termios. c_lflag = self . local_flags . bits ( ) ;
216
233
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
+ }
217
242
}
218
243
self . inner . as_ptr ( )
219
244
}
@@ -226,6 +251,14 @@ impl Termios {
226
251
self . control_flags = ControlFlags :: from_bits_truncate ( termios. c_cflag ) ;
227
252
self . local_flags = LocalFlags :: from_bits_truncate ( termios. c_lflag ) ;
228
253
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
+ }
229
262
}
230
263
}
231
264
@@ -238,6 +271,12 @@ impl From<libc::termios> for Termios {
238
271
control_flags : ControlFlags :: from_bits_truncate ( termios. c_cflag ) ,
239
272
local_flags : LocalFlags :: from_bits_truncate ( termios. c_lflag ) ,
240
273
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 ,
241
280
}
242
281
}
243
282
}
0 commit comments