From a7cc8aa580eaa9d1b264d6fb356971b9c25d6211 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 8 Dec 2022 16:30:08 -0800 Subject: [PATCH 1/3] Add doc aliases for `seek`, `tell`, and `chownat`. --- src/fs/at.rs | 1 + src/fs/fd.rs | 2 ++ 2 files changed, 3 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()) } From a304628ad829301d01b14237b053b4f834e5df04 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 8 Dec 2022 16:33:19 -0800 Subject: [PATCH 2/3] Add a mention of `socket_with` in `socket`'s documentation. --- src/net/socket.rs | 2 ++ 1 file changed, 2 insertions(+) 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] From 81f29845a18eb74c8dfa2c1b94f2622d4e2315bd Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 8 Dec 2022 16:34:31 -0800 Subject: [PATCH 3/3] Fix a broken doc comment link. --- src/io/context.rs | 2 ++ 1 file changed, 2 insertions(+) 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;