Skip to content

Commit

Permalink
unix: add Getresuid, Getresgid for linux
Browse files Browse the repository at this point in the history
Fixes golang/go#60483

Change-Id: Id4c1bf8367066485a16bedeea337c384a3555942
GitHub-Last-Rev: 61f0fe6
GitHub-Pull-Request: #159
Reviewed-on: https://go-review.googlesource.com/c/sys/+/499055
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
  • Loading branch information
mateusz834 authored and gopherbot committed May 31, 2023
1 parent b5c7a09 commit b52f544
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
15 changes: 15 additions & 0 deletions unix/syscall_linux.go
Expand Up @@ -2420,6 +2420,21 @@ func PthreadSigmask(how int, set, oldset *Sigset_t) error {
return rtSigprocmask(how, set, oldset, _C__NSIG/8)
}

//sysnb getresuid(ruid *_C_int, euid *_C_int, suid *_C_int)
//sysnb getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int)

func Getresuid() (ruid, euid, suid int) {
var r, e, s _C_int
getresuid(&r, &e, &s)
return int(r), int(e), int(s)
}

func Getresgid() (rgid, egid, sgid int) {
var r, e, s _C_int
getresgid(&r, &e, &s)
return int(r), int(e), int(s)
}

/*
* Unimplemented
*/
Expand Down
14 changes: 14 additions & 0 deletions unix/zsyscall_linux.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b52f544

Please sign in to comment.