1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#[cfg(not(target_os = "wasi"))]
use crate::io::{Termios, Winsize};
use crate::{imp, io};
use io_lifetimes::{AsFd, BorrowedFd};
#[cfg(not(target_os = "wasi"))]
#[doc(alias = "tcgetattr")]
#[inline]
pub fn ioctl_tcgets<Fd: AsFd>(fd: &Fd) -> io::Result<Termios> {
let fd = fd.as_fd();
imp::syscalls::ioctl_tcgets(fd)
}
#[cfg(any(target_os = "ios", target_os = "macos"))]
#[inline]
pub fn ioctl_fioclex<Fd: AsFd>(fd: &Fd) -> io::Result<()> {
let fd = fd.as_fd();
imp::syscalls::ioctl_fioclex(fd)
}
#[cfg(not(target_os = "wasi"))]
#[inline]
pub fn ioctl_tiocgwinsz(fd: BorrowedFd) -> io::Result<Winsize> {
let fd = fd.as_fd();
imp::syscalls::ioctl_tiocgwinsz(fd)
}
#[inline]
pub fn ioctl_fionbio<Fd: AsFd>(fd: &Fd, value: bool) -> io::Result<()> {
let fd = fd.as_fd();
imp::syscalls::ioctl_fionbio(fd, value)
}
#[cfg(any(
linux_raw,
all(libc, not(any(target_os = "redox", target_os = "wasi")))
))]
#[inline]
pub fn ioctl_tiocexcl<Fd: AsFd>(fd: &Fd) -> io::Result<()> {
let fd = fd.as_fd();
imp::syscalls::ioctl_tiocexcl(fd)
}
#[cfg(any(
linux_raw,
all(libc, not(any(target_os = "redox", target_os = "wasi")))
))]
#[inline]
pub fn ioctl_tiocnxcl<Fd: AsFd>(fd: &Fd) -> io::Result<()> {
let fd = fd.as_fd();
imp::syscalls::ioctl_tiocnxcl(fd)
}