diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-07-07 12:27:00 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-07-07 12:27:00 +0900 |
| commit | 2c7b7ad84525988fb859f877f84d30b41aadbda3 (patch) | |
| tree | 54d2a1e6091b7336a1ff15fefe9d133936fe00d8 | |
| parent | 72c2b66fc01f7bf20ced4b9de180e3d154e5fa39 (diff) | |
container/seccomp: cross-platform sysnum cutoff
Signed-off-by: Ophestra <cat@gensokyo.uk>
| -rwxr-xr-x | container/seccomp/mksysnum_linux.pl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/container/seccomp/mksysnum_linux.pl b/container/seccomp/mksysnum_linux.pl index 50b88b62..2dbd12fd 100755 --- a/container/seccomp/mksysnum_linux.pl +++ b/container/seccomp/mksysnum_linux.pl @@ -4,8 +4,14 @@ # license that can be found in the LICENSE file. use strict; +use POSIX (); my $command = "mksysnum_linux.pl ". join(' ', @ARGV); +my $uname_arch = (POSIX::uname)[4]; +my %syscall_cutoff_arch = ( + "x86_64" => 302, + "aarch64" => 281, +); print <<EOF; // $command @@ -30,7 +36,7 @@ sub fmt { } (my $name_upper = $name) =~ y/a-z/A-Z/; $num = $num + $offset; - if($num > 302){ # not wired in Go standard library + if($num > $syscall_cutoff_arch{$uname_arch}){ # not wired in Go standard library if($state < 0){ print " \"$name\": SYS_$name_upper,\n"; } |
