1use crate::{backend, io};
2use backend::fd::AsFd;
3
4/// `ioctl(fd, TIOCSCTTY, 0)`—Sets the controlling terminal for the processs.
5///
6/// # References
7/// - [Linux]
8/// - [FreeBSD]
9/// - [NetBSD]
10/// - [OpenBSD]
11///
12/// [Linux]: https://man7.org/linux/man-pages/man4/tty_ioctl.4.html
13/// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=tty&sektion=4
14/// [NetBSD]: https://man.netbsd.org/tty.4
15/// [OpenBSD]: https://man.openbsd.org/tty.4
16#[cfg(not(any(windows, target_os = "haiku", target_os = "redox", target_os = "wasi")))]
17#[inline]
18#[doc(alias = "TIOCSCTTY")]
19pub fn ioctl_tiocsctty<Fd: AsFd>(fd: Fd) -> io::Result<()> {
20 backend::process::syscalls::ioctl_tiocsctty(fd.as_fd())
21}
22