Lines Matching refs:pty
9 use nix::pty::*;
204 let pty = openpty(None, None).unwrap();
205 assert!(pty.master > 0);
206 assert!(pty.slave > 0);
211 write(pty.master, string.as_bytes()).unwrap();
212 crate::read_exact(pty.slave, &mut buf);
219 crate::read_exact(pty.master, &mut buf);
225 write(pty.slave, string2.as_bytes()).unwrap();
226 crate::read_exact(pty.master, &mut buf);
230 close(pty.master).unwrap();
231 close(pty.slave).unwrap();
239 // Open one pty to get attributes for the second one
241 let pty = openpty(None, None).unwrap();
242 assert!(pty.master > 0);
243 assert!(pty.slave > 0);
244 let termios = tcgetattr(pty.slave).unwrap();
245 close(pty.master).unwrap();
246 close(pty.slave).unwrap();
252 let pty = openpty(None, &termios).unwrap();
254 assert!(pty.master > 0);
255 assert!(pty.slave > 0);
260 write(pty.master, string.as_bytes()).unwrap();
261 crate::read_exact(pty.slave, &mut buf);
267 crate::read_exact(pty.master, &mut buf);
273 write(pty.slave, string2.as_bytes()).unwrap();
274 crate::read_exact(pty.master, &mut buf);
278 close(pty.master).unwrap();
279 close(pty.slave).unwrap();
294 let pty = unsafe { forkpty(None, None).unwrap() };
295 match pty.fork_result {
306 crate::read_exact(pty.master, &mut buf);
310 close(pty.master).unwrap();