Lines Matching +full:async +full:- +full:io
1 //! Create master and slave virtual pseudo-terminals (PTYs)
7 use std::io;
48 /// so that when it's consumed or goes out of scope, it's automatically cleaned-up.
53 fn as_raw_fd(&self) -> RawFd { in as_raw_fd()
59 fn into_raw_fd(self) -> RawFd { in into_raw_fd()
72 // invalid file descriptor. That frequently indicates a double-close in drop()
82 impl io::Read for PtyMaster {
83 fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> { in read()
84 unistd::read(self.0, buf).map_err(io::Error::from) in read()
88 impl io::Write for PtyMaster {
89 fn write(&mut self, buf: &[u8]) -> io::Result<usize> { in write()
90 unistd::write(self.0, buf).map_err(io::Error::from) in write()
92 fn flush(&mut self) -> io::Result<()> { in flush()
97 impl io::Read for &PtyMaster { impl
98 fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> { in read()
99 unistd::read(self.0, buf).map_err(io::Error::from) in read()
103 impl io::Write for &PtyMaster { impl
104 fn write(&mut self, buf: &[u8]) -> io::Result<usize> { in write()
105 unistd::write(self.0, buf).map_err(io::Error::from) in write()
107 fn flush(&mut self) -> io::Result<()> { in flush()
118 pub fn grantpt(fd: &PtyMaster) -> Result<()> { in grantpt()
143 /// # fn run() -> nix::Result<()> {
160 pub fn posix_openpt(flags: fcntl::OFlag) -> Result<PtyMaster> { in posix_openpt()
171 /// [`ptsname(3)`](https://man7.org/linux/man-pages/man3/ptsname.3.html))
185 /// For a threadsafe and non-`unsafe` alternative on Linux, see `ptsname_r()`.
187 pub unsafe fn ptsname(fd: &PtyMaster) -> Result<String> { in ptsname()
198 /// [`ptsname(3)`](https://man7.org/linux/man-pages/man3/ptsname.3.html))
202 /// POSIX standard and is instead a Linux-specific extension.
209 pub fn ptsname_r(fd: &PtyMaster) -> Result<String> { in ptsname_r()
231 pub fn unlockpt(fd: &PtyMaster) -> Result<()> { in unlockpt()
241 /// (see [`openpty`](https://man7.org/linux/man-pages/man3/openpty.3.html)).
255 ) -> Result<OpenptyResult> { in openpty()
321 /// (see [`forkpty`](https://man7.org/linux/man-pages/man3/forkpty.3.html)).
329 /// In a multithreaded program, only [async-signal-safe] functions like `pause`
331 /// that memory allocation may **not** be async-signal-safe and thus must be
337 /// [async-signal-safe]: https://man7.org/linux/man-pages/man7/signal-safety.7.html
341 ) -> Result<ForkptyResult> {