syscall_linux_arm.go 489 B

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