Files
runc/system/syscall_linux_64.go
T
Adam Conrad 38ef9ee346 Add support for ARMv8 (AKA: arm64 or Aarch64)
Signed-off-by: Adam Conrad <adconrad@0c3.net>
2015-04-10 12:48:48 -06:00

26 lines
537 B
Go

// +build linux,arm64 linux,amd64 linux,ppc64 linux,ppc64le linux,s390x
package system
import (
"syscall"
)
// Setuid sets the uid of the calling thread to the specified uid.
func Setuid(uid int) (err error) {
_, _, e1 := syscall.RawSyscall(syscall.SYS_SETUID, uintptr(uid), 0, 0)
if e1 != 0 {
err = e1
}
return
}
// Setgid sets the gid of the calling thread to the specified gid.
func Setgid(gid int) (err error) {
_, _, e1 := syscall.RawSyscall(syscall.SYS_SETGID, uintptr(gid), 0, 0)
if e1 != 0 {
err = e1
}
return
}