aboutsummaryrefslogtreecommitdiff
path: root/internal/syscallcompat/thread_credentials_linux_368_arm.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2025-02-26 21:21:57 +0100
committerJakob Unterwurzacher2025-02-26 21:27:29 +0100
commit987ced003ec2971797e8969e0cf0a37a751ebc84 (patch)
treecff93745a96ed7a1fea5de9b4eb3c5f879b252a2 /internal/syscallcompat/thread_credentials_linux_368_arm.go
parent22cd9cf174e8a93787b01f6dd7b09247f9642286 (diff)
syscallcompat: rename thread_credentials files to include "linux"
As with the other files, include "linux" because the code only builds on linux renamed: internal/syscallcompat/thread_credentials.go -> internal/syscallcompat/thread_credentials_linux.go renamed: internal/syscallcompat/thread_credentials_368_arm.go -> internal/syscallcompat/thread_credentials_linux_368_arm.go renamed: internal/syscallcompat/thread_credentials_other.go -> internal/syscallcompat/thread_credentials_linux_other.go
Diffstat (limited to 'internal/syscallcompat/thread_credentials_linux_368_arm.go')
-rw-r--r--internal/syscallcompat/thread_credentials_linux_368_arm.go35
1 files changed, 35 insertions, 0 deletions
diff --git a/internal/syscallcompat/thread_credentials_linux_368_arm.go b/internal/syscallcompat/thread_credentials_linux_368_arm.go
new file mode 100644
index 0000000..e244a15
--- /dev/null
+++ b/internal/syscallcompat/thread_credentials_linux_368_arm.go
@@ -0,0 +1,35 @@
+//go:build (linux && 386) || (linux && arm)
+
+package syscallcompat
+
+import (
+ "unsafe"
+
+ "golang.org/x/sys/unix"
+)
+
+// See thread_credentials_linux.go for docs
+
+func Setreuid(ruid int, euid int) (err error) {
+ _, _, e1 := unix.RawSyscall(unix.SYS_SETREUID32, uintptr(ruid), uintptr(euid), 0)
+ if e1 != 0 {
+ err = e1
+ }
+ return
+}
+
+func Setregid(rgid int, egid int) (err error) {
+ _, _, e1 := unix.RawSyscall(unix.SYS_SETREGID32, uintptr(rgid), uintptr(egid), 0)
+ if e1 != 0 {
+ err = e1
+ }
+ return
+}
+
+func setgroups(n int, list *uint32) (err error) {
+ _, _, e1 := unix.RawSyscall(unix.SYS_SETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0)
+ if e1 != 0 {
+ err = e1
+ }
+ return
+}