Skip to content

Commit

Permalink
Add doc aliases for seek, tell, and chownat. (#481)
Browse files Browse the repository at this point in the history
* Add doc aliases for `seek`, `tell`, and `chownat`.

* Add a mention of `socket_with` in `socket`'s documentation.

* Fix a broken doc comment link.
  • Loading branch information
sunfishcode committed Dec 13, 2022
1 parent 52fc789 commit cb074ea
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/fs/at.rs
Expand Up @@ -374,6 +374,7 @@ pub fn mknodat<P: path::Arg, Fd: AsFd>(
/// [Linux]: https://man7.org/linux/man-pages/man2/fchownat.2.html
#[cfg(not(target_os = "wasi"))]
#[inline]
#[doc(alias = "fchownat")]
pub fn chownat<P: path::Arg, Fd: AsFd>(
dirfd: Fd,
path: P,
Expand Down
2 changes: 2 additions & 0 deletions src/fs/fd.rs
Expand Up @@ -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: AsFd>(fd: Fd, pos: SeekFrom) -> io::Result<u64> {
backend::fs::syscalls::seek(fd.as_fd(), pos)
}
Expand All @@ -104,6 +105,7 @@ pub fn seek<Fd: AsFd>(fd: Fd, pos: SeekFrom) -> io::Result<u64> {
/// [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: AsFd>(fd: Fd) -> io::Result<u64> {
backend::fs::syscalls::tell(fd.as_fd())
}
Expand Down
2 changes: 2 additions & 0 deletions src/io/context.rs
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/net/socket.rs
Expand Up @@ -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]
Expand Down

0 comments on commit cb074ea

Please sign in to comment.