(fd: Fd)
| 169 | /// [`Signal::CHILD`]: crate::process::Signal::CHILD |
| 170 | #[inline] |
| 171 | pub fn grantpt<Fd: AsFd>(fd: Fd) -> io::Result<()> { |
| 172 | #[cfg(not(linux_kernel))] |
| 173 | { |
| 174 | backend::pty::syscalls::grantpt(fd.as_fd()) |
| 175 | } |
| 176 | |
| 177 | // On Linux, we assume the kernel has already granted the needed |
| 178 | // permissions to the user side of the pseudoterminal. |
| 179 | #[cfg(linux_kernel)] |
| 180 | { |
| 181 | let _ = fd; |
| 182 | Ok(()) |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | /// `ioctl(fd, TIOCGPTPEER)`—Open the user side of a pseudoterminal. |
| 187 | /// |