()
| 5 | #[cfg(feature = "fs")] |
| 6 | #[test] |
| 7 | fn pgrp_notty() { |
| 8 | let tmpdir = tempdir().unwrap(); |
| 9 | let fd = rustix::fs::open( |
| 10 | tmpdir.path(), |
| 11 | rustix::fs::OFlags::RDONLY, |
| 12 | rustix::fs::Mode::empty(), |
| 13 | ) |
| 14 | .unwrap(); |
| 15 | |
| 16 | // A file is not a tty. |
| 17 | assert_eq!(tcgetpgrp(&fd), Err(Errno::NOTTY)); |
| 18 | assert_eq!(tcsetpgrp(&fd, Pid::INIT), Err(Errno::NOTTY)); |
| 19 | } |
| 20 | |
| 21 | // Disable on illumos where `tcgetattr` doesn't appear to support |
| 22 | // pseudoterminals. And on Redox which lacks `NOCTTY`. |