From 4b7e0bb3ceea1a60acb128eac371b9c01e1e161c Mon Sep 17 00:00:00 2001 From: Jake Shadle Date: Wed, 21 Feb 2024 10:54:55 +0100 Subject: [PATCH] Add links to nix src --- src/direct/ffi.rs | 5 ++++- src/error.rs | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/direct/ffi.rs b/src/direct/ffi.rs index 6ce2c09..dabdc6e 100644 --- a/src/direct/ffi.rs +++ b/src/direct/ffi.rs @@ -71,6 +71,7 @@ pub struct snd_pcm_sync_ptr { pub c: snd_pcm_mmap_control_r, } +/// See #[cfg(any(target_os = "linux", target_os = "android"))] mod ioctl_helpers { #[cfg(any(target_os = "android", target_env = "musl"))] @@ -105,7 +106,7 @@ mod ioctl_helpers { const SIZESHIFT: ioctl_num_type = TYPESHIFT + 8 /* TYPEBITS */; const DIRSHIFT: ioctl_num_type = SIZESHIFT + 13 /* SIZEBITS */; - /// Replication of the `nix::ioc!` + /// Replication of the [`nix::ioc!`](https://github.com/nix-rust/nix/blob/197f55b3ccbce3273bf6ce119d1a8541b5df5d66/src/sys/ioctl/linux.rs#L78-L96) pub(super) const fn make_request( dir: ioctl_num_type, typ: u8, @@ -119,6 +120,7 @@ mod ioctl_helpers { } } +/// See #[cfg(any( target_os = "dragonfly", target_os = "freebsd", @@ -140,6 +142,7 @@ mod ioctl_helpers { const IOCPARM_MASK: ioctl_num_type = 0x1fff; + /// Replication of [`nix::ioc!`](https://github.com/nix-rust/nix/blob/197f55b3ccbce3273bf6ce119d1a8541b5df5d66/src/sys/ioctl/bsd.rs#L31-L42) pub(super) const fn make_request( dir: ioctl_num_type, typ: u8, diff --git a/src/error.rs b/src/error.rs index 76342d0..ec45498 100644 --- a/src/error.rs +++ b/src/error.rs @@ -119,6 +119,10 @@ impl fmt::Display for Error { } } +/// See +/// +/// Note this doesn't include the total set of possible errno variants, but they +/// can easily be added in the future for better error messages fn desc(errno: i32) -> &'static str { match errno { libc::EPERM => "Operation not permitted",