Lines Matching +full:use +full:- +full:pty
4 //! [rustix-openpty crate].
6 //! [rustix-openpty crate]: https://crates.io/crates/rustix-openpty
10 use crate::backend::c;
11 use crate::fd::{AsFd, OwnedFd};
12 use crate::fs::OFlags;
13 use crate::{backend, io};
18 use {crate::ffi::CString, alloc::vec::Vec};
21 use crate::{fd::FromRawFd, ioctl};
24 /// `O_*` flags for use with [`openpt`] and [`ioctl_tiocgptpeer`].
26 …/// [`ioctl_tiocgptpeer`]: https://docs.rs/rustix/*/x86_64-unknown-linux-gnu/rustix/pty/fn.ioctl_t…
44 /// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
51 fn from(flags: OpenptFlags) -> Self { in from()
60 /// close-on-exec flag be set.
68 /// - [POSIX]
69 /// - [Linux]
70 /// - [Apple]
71 /// - [FreeBSD]
72 /// - [DragonFly BSD]
73 /// - [NetBSD]
74 /// - [OpenBSD]
75 /// - [illumos]
78 /// [Linux]: https://man7.org/linux/man-pages/man3/posix_openpt.3.html
87 pub fn openpt(flags: OpenptFlags) -> io::Result<OwnedFd> { in openpt()
91 use crate::fs::{open, Mode}; in openpt()
99 // On all other platforms, use `openpt`. in openpt()
102 backend::pty::syscalls::openpt(flags) in openpt()
109 /// - [POSIX]
110 /// - [Linux]
111 /// - [glibc]
114 /// [Linux]: https://man7.org/linux/man-pages/man3/ptsname.3.html
115 /// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Allocation.html#index-ptsname
122 pub fn ptsname<Fd: AsFd, B: Into<Vec<u8>>>(fd: Fd, reuse: B) -> io::Result<CString> { in ptsname()
123 backend::pty::syscalls::ptsname(fd.as_fd(), reuse.into()) in ptsname()
129 /// - [POSIX]
130 /// - [Linux]
131 /// - [glibc]
134 /// [Linux]: https://man7.org/linux/man-pages/man3/unlockpt.3.html
135 /// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Allocation.html#index-unlockpt
137 pub fn unlockpt<Fd: AsFd>(fd: Fd) -> io::Result<()> { in unlockpt()
138 backend::pty::syscalls::unlockpt(fd.as_fd()) in unlockpt()
149 /// - [POSIX]
150 /// - [Linux]
151 /// - [glibc]
154 /// [Linux]: https://man7.org/linux/man-pages/man3/grantpt.3.html
155 /// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Allocation.html#index-grantpt
158 pub fn grantpt<Fd: AsFd>(fd: Fd) -> io::Result<()> { in grantpt()
161 backend::pty::syscalls::grantpt(fd.as_fd()) in grantpt()
178 /// - [Linux]
180 /// [Linux]: https://man7.org/linux/man-pages/man2/ioctl_tty.2.html
183 pub fn ioctl_tiocgptpeer<Fd: AsFd>(fd: Fd, flags: OpenptFlags) -> io::Result<OwnedFd> { in ioctl_tiocgptpeer()
197 fn as_ptr(&mut self) -> *mut c::c_void { in as_ptr()
204 ) -> io::Result<Self::Output> { in output_from_ptr()