syscall_table: expose get_syscall_nr without json#101
Open
lu-zero wants to merge 1 commit into
Open
Conversation
Programmatic filter construction needs name-to-number resolution without enabling the JSON frontend. Always compile the syscall tables and export get_syscall_nr(name, arch). Add unit and integration coverage for host and cross-arch lookups. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
lu-zero
force-pushed
the
pr/get-syscall-nr
branch
from
July 18, 2026 12:32
91b5b20 to
f1584c4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expose architecture-specific syscall name lookup for callers that build filters in Rust without using the JSON frontend.
syscall_table(no longer gated on thejsonfeature)get_syscall_nr(name, arch) -> Option<i64>Rationale
hakoniwa could move its seccomp backend from libseccomp to seccompiler. It keeps its own filter IR and OCI/podman-style profile loader; it only needs seccompiler for name→number resolution, BPF compilation, and install.
Today the syscall tables are only linked when the
jsonfeature is enabled, so a pure library consumer cannot resolve names like"openat"without also pulling in the JSON frontend.get_syscall_nrfills that gap in the same way programmatic builders need (and matches the “skip unknown syscalls” pattern used with libseccomp’s name lookup).This is a small, self-contained slice of that work; further PRs will cover per-rule actions, optional
PR_SET_NO_NEW_PRIVS, and related install helpers.Testing