Skip to main content

nr_for_name

Function nr_for_name 

Source
pub fn nr_for_name(name: &str) -> Option<i64>
Expand description

Resolve a syscall name — as written in a profile’s Syscalls::Deny list — to its architecture-native syscall number.

Returns None for any name this crate does not recognize. Callers must treat an unknown name as a hard error rather than silently dropping it: a dropped deny entry makes the installed filter less restrictive than the author intended, silently leaving a syscall reachable.

The recognized set is intentionally limited to syscalls that exist on every Linux architecture this project targets, expressed in their modern spelling (openat not open, ppoll not poll, dup3 not dup2, newfstatat not stat). Legacy aliases can be added behind an architecture cfg when a worker genuinely needs them.