syscallnrs

Crates.iosyscallnrs
lib.rssyscallnrs
version0.1.2
created_at2025-09-20 15:49:03.927153+00
updated_at2025-10-20 16:07:38.560732+00
descriptionUses your systems to build maps from system call numbers to names (and vice versa).
homepage
repositoryhttps://github.com/mgree/syscallnrs
max_upload_size
id1847881
size8,462
Michael Greenberg (mgree)

documentation

README

syscallnrs

Crates.io Version

Uses your system's syscall.h to build mappings from system call names to numbers. It provides three such mappings:

  • SYSCALLS, a static slice of pairs of system call names and numbers;
  • syscall_of_nr, a function which looks up a system call name given a number; and
  • nr_of_syscall, a function which looks up a number given a system call.

The code for these is generated statically. Both functions are generated as large matches rather than data structure lookups.

To use this in your project:

[dependencies]
syscallnrs = "0.1"

Requirements

The build-time code generation requires a C compiler (GCC or clang should work) and standard utilities (grep, cut, and sed). The tests require objdump (to confirm that the extracted system calls are correct).

Commit count: 6

cargo fmt