Skip to content

Commit

Permalink
Add links to nix src
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Shadle committed Feb 21, 2024
1 parent d1ed7d5 commit 4b7e0bb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/direct/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ pub struct snd_pcm_sync_ptr {
pub c: snd_pcm_mmap_control_r,
}

/// See <https://github.com/nix-rust/nix/blob/197f55b3ccbce3273bf6ce119d1a8541b5df5d66/src/sys/ioctl/linux.rs>
#[cfg(any(target_os = "linux", target_os = "android"))]
mod ioctl_helpers {
#[cfg(any(target_os = "android", target_env = "musl"))]
Expand Down Expand Up @@ -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,
Expand All @@ -119,6 +120,7 @@ mod ioctl_helpers {
}
}

/// See <https://github.com/nix-rust/nix/blob/197f55b3ccbce3273bf6ce119d1a8541b5df5d66/src/sys/ioctl/bsd.rs>
#[cfg(any(
target_os = "dragonfly",
target_os = "freebsd",
Expand All @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ impl fmt::Display for Error {
}
}

/// See <https://github.com/nix-rust/nix/blob/197f55b3ccbce3273bf6ce119d1a8541b5df5d66/src/errno.rs#L198>
///
/// 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",
Expand Down

0 comments on commit 4b7e0bb

Please sign in to comment.