rustix/fs/
getpath.rs

1use crate::ffi::CString;
2use crate::{backend, io};
3use backend::fd::AsFd;
4
5/// `fcntl(fd, F_GETPATH)`
6///
7/// # References
8///  - [Apple]
9///
10/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/fcntl.2.html
11#[inline]
12pub fn getpath<Fd: AsFd>(fd: Fd) -> io::Result<CString> {
13    backend::fs::syscalls::getpath(fd.as_fd())
14}