Lines Matching defs:libc
4 //! underlying types are all implemented in libc for most platforms and either wrapped in safer
11 //! It should be noted that this API incurs some runtime overhead above the base `libc` definitions.
221 use libc::{self, c_int, tcflag_t};
232 /// This is a wrapper around the `libc::termios` struct that provides a safe interface for the
237 inner: RefCell<libc::termios>,
247 pub control_chars: [libc::cc_t; NCCS],
250 pub line_discipline: libc::cc_t,
253 pub line_discipline: libc::c_char,
257 /// Exposes an immutable reference to the underlying `libc::termios` data structure.
261 pub(crate) fn get_libc_termios(&self) -> Ref<libc::termios> {
281 /// Exposes the inner `libc::termios` datastore within `Termios`.
283 /// This is unsafe because if this is used to modify the inner `libc::termios` struct, it will
287 pub(crate) unsafe fn get_libc_termios_mut(&mut self) -> *mut libc::termios {
307 /// Updates the wrapper values from the internal `libc::termios` data structure.
326 impl From<libc::termios> for Termios {
327 fn from(termios: libc::termios) -> Self {
345 impl From<Termios> for libc::termios {
463 impl TryFrom<libc::speed_t>
613 pub use libc::NCCS;
624 pub use libc::_POSIX_VDISABLE;
823 NLDLY as tcflag_t; // FIXME: Datatype needs to be corrected in libc for mac
1007 unsafe { libc::cfgetispeed(&*inner_termios) as u32 }
1018 unsafe { libc::cfgetospeed(&*inner_termios) as u32 }
1027 let res = unsafe { libc::cfsetispeed(inner_termios, baud.into() as libc::speed_t) };
1038 let res = unsafe { libc::cfsetospeed(inner_termios, baud.into() as libc::speed_t) };
1050 let res = unsafe { libc::cfsetspeed(inner_termios, baud.into() as libc::speed_t) };
1063 unsafe { libc::cfgetispeed(&*inner_termios) }.try_into().unwrap()
1072 unsafe { libc::cfgetospeed(&*inner_termios) }.try_into().unwrap()
1081 let res = unsafe { libc::cfsetispeed(inner_termios, baud as libc::speed_t) };
1092 let res = unsafe { libc::cfsetospeed(inner_termios, baud as libc::speed_t) };
1105 let res = unsafe { libc::cfsetspeed(inner_termios, baud as libc::speed_t) };
1121 libc::cfmakeraw(inner_termios);
1135 libc::cfmakesane(inner_termios);
1149 let res = unsafe { libc::tcgetattr(fd, termios.as_mut_ptr()) };
1165 libc::tcsetattr(fd, actions as c_int, &*inner_termios)
1173 Errno::result(unsafe { libc::tcdrain(fd) }).map(drop)
1182 Errno::result(unsafe { libc::tcflow(fd, action as c_int) }).map(drop)
1191 Errno::result(unsafe { libc::tcflush(fd, action as c_int) }).map(drop)
1200 Errno::result(unsafe { libc::tcsendbreak(fd, duration) }).map(drop)
1208 let res = unsafe { libc::tcgetsid(fd) };
1221 assert_eq!(Ok(BaudRate::B0), BaudRate::try_from(libc::B0));