3f780f312bd575f98329fd5447872c100bc55333
[oom/registrator.git] /
1 // +build linux,arm
2
3 package system
4
5 import (
6         "syscall"
7 )
8
9 // Setuid sets the uid of the calling thread to the specified uid.
10 func Setuid(uid int) (err error) {
11         _, _, e1 := syscall.RawSyscall(syscall.SYS_SETUID32, uintptr(uid), 0, 0)
12         if e1 != 0 {
13                 err = e1
14         }
15         return
16 }
17
18 // Setgid sets the gid of the calling thread to the specified gid.
19 func Setgid(gid int) (err error) {
20         _, _, e1 := syscall.RawSyscall(syscall.SYS_SETGID32, uintptr(gid), 0, 0)
21         if e1 != 0 {
22                 err = e1
23         }
24         return
25 }