Skip to content

Commit cb074ea

Browse files
authored
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.
1 parent 52fc789 commit cb074ea

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

src/fs/at.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ pub fn mknodat<P: path::Arg, Fd: AsFd>(
374374
/// [Linux]: https://man7.org/linux/man-pages/man2/fchownat.2.html
375375
#[cfg(not(target_os = "wasi"))]
376376
#[inline]
377+
#[doc(alias = "fchownat")]
377378
pub fn chownat<P: path::Arg, Fd: AsFd>(
378379
dirfd: Fd,
379380
path: P,

src/fs/fd.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ pub const NFS_SUPER_MAGIC: FsWord = backend::fs::types::NFS_SUPER_MAGIC;
8787
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html
8888
/// [Linux]: https://man7.org/linux/man-pages/man2/lseek.2.html
8989
#[inline]
90+
#[doc(alias = "lseek")]
9091
pub fn seek<Fd: AsFd>(fd: Fd, pos: SeekFrom) -> io::Result<u64> {
9192
backend::fs::syscalls::seek(fd.as_fd(), pos)
9293
}
@@ -104,6 +105,7 @@ pub fn seek<Fd: AsFd>(fd: Fd, pos: SeekFrom) -> io::Result<u64> {
104105
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html
105106
/// [Linux]: https://man7.org/linux/man-pages/man2/lseek.2.html
106107
#[inline]
108+
#[doc(alias = "lseek")]
107109
pub fn tell<Fd: AsFd>(fd: Fd) -> io::Result<u64> {
108110
backend::fs::syscalls::tell(fd.as_fd())
109111
}

src/io/context.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ impl<'a, T: fmt::Debug> fmt::Debug for Ref<'a, T> {
4545
}
4646

4747
/// A trait for data stored within an [`Epoll`] instance.
48+
///
49+
/// [`Epoll`]: crate::io::epoll::Epoll
4850
pub trait Context {
4951
/// The type of an element owned by this context.
5052
type Data;

src/net/socket.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ impl Default for Protocol {
2222
/// however it is not safe in general to rely on this, as file descriptors
2323
/// may be unexpectedly allocated on other threads or in libraries.
2424
///
25+
/// To pass extra flags such as [`SocketFlags::CLOEXEC`], use [`socket_with`].
26+
///
2527
/// # References
2628
/// - [POSIX]
2729
/// - [Linux]

0 commit comments

Comments
 (0)