github.com/zhuohuang-hust/src-cbuild@v0.0.0-20230105071821-c7aab3e7c840/mergeCode/runc/libcontainer/system/syscall_linux_386.go (about)

     1  // +build linux,386
     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  }