MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / grantpt

Function grantpt

src/pty.rs:171–184  ·  view source on GitHub ↗
(fd: Fd)

Source from the content-addressed store, hash-verified

169/// [`Signal::CHILD`]: crate::process::Signal::CHILD
170#[inline]
171pub 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///

Callers 2

openpty_basicFunction · 0.50
openpty_get_peerFunction · 0.50

Calls 1

as_fdMethod · 0.45

Tested by 2

openpty_basicFunction · 0.40
openpty_get_peerFunction · 0.40