From cb074ea0cab2f55c6e19e9f23a1fc01d817f21c0 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 13 Dec 2022 10:27:34 -0800 Subject: [PATCH] Add doc aliases for `seek`, `tell`, and `chownat`. (#481) * Add doc aliases for `seek`, `tell`, and `chownat`. * Add a mention of `socket_with` in `socket`'s documentation. * Fix a broken doc comment link. --- src/fs/at.rs | 1 + src/fs/fd.rs | 2 ++ src/io/context.rs | 2 ++ src/net/socket.rs | 2 ++ 4 files changed, 7 insertions(+) diff --git a/src/fs/at.rs b/src/fs/at.rs index 925a0aa01..8e0d480bb 100644 --- a/src/fs/at.rs +++ b/src/fs/at.rs @@ -374,6 +374,7 @@ pub fn mknodat( /// [Linux]: https://man7.org/linux/man-pages/man2/fchownat.2.html #[cfg(not(target_os = "wasi"))] #[inline] +#[doc(alias = "fchownat")] pub fn chownat( dirfd: Fd, path: P, diff --git a/src/fs/fd.rs b/src/fs/fd.rs index 6bea89547..1fede6b49 100644 --- a/src/fs/fd.rs +++ b/src/fs/fd.rs @@ -87,6 +87,7 @@ pub const NFS_SUPER_MAGIC: FsWord = backend::fs::types::NFS_SUPER_MAGIC; /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html /// [Linux]: https://man7.org/linux/man-pages/man2/lseek.2.html #[inline] +#[doc(alias = "lseek")] pub fn seek(fd: Fd, pos: SeekFrom) -> io::Result { backend::fs::syscalls::seek(fd.as_fd(), pos) } @@ -104,6 +105,7 @@ pub fn seek(fd: Fd, pos: SeekFrom) -> io::Result { /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html /// [Linux]: https://man7.org/linux/man-pages/man2/lseek.2.html #[inline] +#[doc(alias = "lseek")] pub fn tell(fd: Fd) -> io::Result { backend::fs::syscalls::tell(fd.as_fd()) } diff --git a/src/io/context.rs b/src/io/context.rs index 61788ef34..cf2a1a89a 100644 --- a/src/io/context.rs +++ b/src/io/context.rs @@ -45,6 +45,8 @@ impl<'a, T: fmt::Debug> fmt::Debug for Ref<'a, T> { } /// A trait for data stored within an [`Epoll`] instance. +/// +/// [`Epoll`]: crate::io::epoll::Epoll pub trait Context { /// The type of an element owned by this context. type Data; diff --git a/src/net/socket.rs b/src/net/socket.rs index 687022afe..2b1ac0c02 100644 --- a/src/net/socket.rs +++ b/src/net/socket.rs @@ -22,6 +22,8 @@ impl Default for Protocol { /// however it is not safe in general to rely on this, as file descriptors /// may be unexpectedly allocated on other threads or in libraries. /// +/// To pass extra flags such as [`SocketFlags::CLOEXEC`], use [`socket_with`]. +/// /// # References /// - [POSIX] /// - [Linux]