| Crates.io | syscallnrs |
| lib.rs | syscallnrs |
| version | 0.1.2 |
| created_at | 2025-09-20 15:49:03.927153+00 |
| updated_at | 2025-10-20 16:07:38.560732+00 |
| description | Uses your systems |
| homepage | |
| repository | https://github.com/mgree/syscallnrs |
| max_upload_size | |
| id | 1847881 |
| size | 8,462 |
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; andnr_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"
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).