aboutsummaryrefslogtreecommitdiff
path: root/internal/syscallcompat/thread_credentials_368_arm.go
blob: 1244160e8342b827aaf1049c52053c8ef969f794 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//go:build (linux && 386) || (linux && arm)

package syscallcompat

import (
	"unsafe"

	"golang.org/x/sys/unix"
)

// See thread_credentials.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
}