From 199b63822535bf2c1f406bc0f6135563b00a0664 Mon Sep 17 00:00:00 2001 From: Jeff Mahoney Date: Tue, 10 Mar 2026 14:15:51 -0400 Subject: [PATCH] Use the syscall number definitions from syscall module Rather than declaring each architecture's syscall numbers, use the ones from the syscall module. This means this package doesn't need to be modified every time someone wants to use it on a new architecture. --- sys_linux.go | 5 +++++ sys_linux_386.go | 7 ------- sys_linux_amd64.go | 7 ------- sys_linux_arm.go | 7 ------- 4 files changed, 5 insertions(+), 21 deletions(-) delete mode 100644 sys_linux_386.go delete mode 100644 sys_linux_amd64.go delete mode 100644 sys_linux_arm.go diff --git a/sys_linux.go b/sys_linux.go index 0c4c194..dec5229 100644 --- a/sys_linux.go +++ b/sys_linux.go @@ -9,6 +9,11 @@ type keyctlCommand int type keyId int32 +const ( + syscall_keyctl uintptr = syscall.SYS_KEYCTL + syscall_add_key uintptr = syscall.SYS_ADD_KEY + syscall_setfsgid uintptr = syscall.SYS_SETFSGID +) const ( keySpecThreadKeyring keyId = -1 keySpecProcessKeyring keyId = -2 diff --git a/sys_linux_386.go b/sys_linux_386.go deleted file mode 100644 index 0442bee..0000000 --- a/sys_linux_386.go +++ /dev/null @@ -1,7 +0,0 @@ -package keyctl - -const ( - syscall_keyctl uintptr = 288 - syscall_add_key uintptr = 286 - syscall_setfsgid uintptr = 139 -) diff --git a/sys_linux_amd64.go b/sys_linux_amd64.go deleted file mode 100644 index f36f316..0000000 --- a/sys_linux_amd64.go +++ /dev/null @@ -1,7 +0,0 @@ -package keyctl - -const ( - syscall_keyctl uintptr = 250 - syscall_add_key uintptr = 248 - syscall_setfsgid uintptr = 123 -) diff --git a/sys_linux_arm.go b/sys_linux_arm.go deleted file mode 100644 index 0542a61..0000000 --- a/sys_linux_arm.go +++ /dev/null @@ -1,7 +0,0 @@ -package keyctl - -const ( - syscall_keyctl uintptr = 311 - syscall_add_key uintptr = 309 - syscall_setfsgid uintptr = 139 -)