af248a3f |
// +build linux
// +build 386 arm |
c86189d5 |
|
291b8461 |
package system
import ( |
45d85c99 |
"golang.org/x/sys/unix" |
291b8461 |
)
// Setuid sets the uid of the calling thread to the specified uid.
func Setuid(uid int) (err error) { |
45d85c99 |
_, _, e1 := unix.RawSyscall(unix.SYS_SETUID32, uintptr(uid), 0, 0) |
291b8461 |
if e1 != 0 {
err = e1
}
return
}
// Setgid sets the gid of the calling thread to the specified gid.
func Setgid(gid int) (err error) { |
45d85c99 |
_, _, e1 := unix.RawSyscall(unix.SYS_SETGID32, uintptr(gid), 0, 0) |
291b8461 |
if e1 != 0 {
err = e1
}
return
} |