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

Function readlinkat_raw

src/fs/at.rs:176–187  ·  view source on GitHub ↗
(
    dirfd: Fd,
    path: P,
    mut buf: Buf,
)

Source from the content-addressed store, hash-verified

174#[cfg(not(target_os = "redox"))]
175#[inline]
176pub fn readlinkat_raw<P: path::Arg, Fd: AsFd, Buf: Buffer<u8>>(
177 dirfd: Fd,
178 path: P,
179 mut buf: Buf,
180) -> io::Result<Buf::Output> {
181 // SAFETY: `readlinkat` behaves.
182 let len = path.into_with_c_str(|path| unsafe {
183 backend::fs::syscalls::readlinkat(dirfd.as_fd(), path, buf.parts_mut())
184 })?;
185 // SAFETY: `readlinkat` behaves.
186 unsafe { Ok(buf.assume_init(len)) }
187}
188
189/// `mkdirat(fd, path, mode)`—Creates a directory.
190///

Callers 2

ttynameFunction · 0.85
test_readlinkat_rawFunction · 0.85

Calls 5

into_with_c_strMethod · 0.80
parts_mutMethod · 0.80
assume_initMethod · 0.80
readlinkatFunction · 0.70
as_fdMethod · 0.45

Tested by 1

test_readlinkat_rawFunction · 0.68