summaryrefslogtreecommitdiffstats
path: root/vendor/rustix/src/fs/getpath.rs
blob: bc40890d1a53ed2b414fa9908c7bd77a2c167580 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::ffi::CString;
use crate::{imp, io};
use imp::fd::AsFd;

/// `fcntl(fd, F_GETPATH)`
///
/// # References
///  - [Apple]
///
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/fcntl.2.html
#[inline]
pub fn getpath<Fd: AsFd>(fd: Fd) -> io::Result<CString> {
    imp::fs::syscalls::getpath(fd.as_fd())
}