1 //! Process-oriented `ioctl`s.
5 //! This module invokes `ioctl`s.
9 use crate::{backend, io, ioctl}
;
11 use backend
::fd
::AsFd
;
13 /// `ioctl(fd, TIOCSCTTY, 0)`—Sets the controlling terminal for the processs.
21 /// [Linux]: https://man7.org/linux/man-pages/man4/tty_ioctl.4.html
22 /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=tty&sektion=4
23 /// [NetBSD]: https://man.netbsd.org/tty.4
24 /// [OpenBSD]: https://man.openbsd.org/tty.4
25 #[cfg(not(any(windows, target_os = "aix", target_os = "redox", target_os = "wasi")))]
27 #[doc(alias = "TIOCSCTTY")]
28 pub fn ioctl_tiocsctty
<Fd
: AsFd
>(fd
: Fd
) -> io
::Result
<()> {
29 unsafe { ioctl::ioctl(fd, Tiocsctty) }
32 #[cfg(not(any(windows, target_os = "aix", target_os = "redox", target_os = "wasi")))]
35 #[cfg(not(any(windows, target_os = "aix", target_os = "redox", target_os = "wasi")))]
36 unsafe impl ioctl
::Ioctl
for Tiocsctty
{
39 const IS_MUTATING
: bool
= false;
40 const OPCODE
: ioctl
::Opcode
= ioctl
::Opcode
::old(c
::TIOCSCTTY
as ioctl
::RawOpcode
);
42 fn as_ptr(&mut self) -> *mut c
::c_void
{
43 (&0u32) as *const u32 as *mut c
::c_void
46 unsafe fn output_from_ptr(
47 _
: ioctl
::IoctlOutput
,
49 ) -> io
::Result
<Self::Output
> {