Host kernel capability probing, privilege inspection, and human-readable feature diagnostics for Linux eBPF environments.
On non-Linux hosts (such as macOS), capabilities/0 returns a clean
supported: false capability map without invoking the Linux NIF.
Summary
Functions
Probes the current host's Linux kernel, BPF feature support, process
capabilities, and RLIMIT_MEMLOCK.
Checks whether a probed capability map satisfies the kernel version, feature,
privilege, and memory-lock requirements for feature.
Formats a human-readable diagnostic summary for feature against caps.
Parses a Linux CapEff hex bitmask string or full /proc/self/status text
and decodes the BPF-relevant capability flags
Parses a Linux uname -r kernel release string into {major, minor, patch}.
Compares two {major, minor, patch} kernel version tuples.
Types
@type kernel_version() :: {non_neg_integer(), non_neg_integer(), non_neg_integer()}
Functions
Probes the current host's Linux kernel, BPF feature support, process
capabilities, and RLIMIT_MEMLOCK.
On non-Linux platforms (such as :darwin), returns {:ok, %{platform: ..., supported: false, ...}}.
Checks whether a probed capability map satisfies the kernel version, feature,
privilege, and memory-lock requirements for feature.
Returns :ok if supported or {:error, message} with an actionable
remediation string.
Formats a human-readable diagnostic summary for feature against caps.
Returns "<feature>: supported" when all requirements pass, or a detailed
remediation string when one or more checks fail.
Parses a Linux CapEff hex bitmask string or full /proc/self/status text
and decodes the BPF-relevant capability flags:
cap_net_admin(CAP_NET_ADMIN, bit 12)cap_sys_admin(CAP_SYS_ADMIN, bit 21)cap_perfmon(CAP_PERFMON, bit 38)cap_bpf(CAP_BPF, bit 39)
@spec parse_kernel_release(binary()) :: {:ok, kernel_version()} | {:error, :invalid_kernel_release}
Parses a Linux uname -r kernel release string into {major, minor, patch}.
Examples:
"6.18.57-current-rockchip64"->{:ok, {6, 18, 57}}"5.15.0"->{:ok, {5, 15, 0}}"6.6"->{:ok, {6, 6, 0}}
@spec version_at_least?(kernel_version(), kernel_version()) :: boolean()
Compares two {major, minor, patch} kernel version tuples.