os: implement process related functions

This commit implements various process related functions like
os.Getuid() and os.Getpid(). It also implements or improves this support
in the syscall package if it isn't available yet.
This commit is contained in:
Ayke van Laethem
2021-06-25 15:06:17 +02:00
committed by Ron Evans
parent e65592599c
commit 75298bb84b
8 changed files with 99 additions and 15 deletions
+28
View File
@@ -24,3 +24,31 @@ func runtime_args() []string // in package runtime
func Exit(code int) {
syscall.Exit(code)
}
// Getuid returns the numeric user id of the caller.
//
// On non-POSIX systems, it returns -1.
func Getuid() int {
return syscall.Getuid()
}
// Geteuid returns the numeric effective user id of the caller.
//
// On non-POSIX systems, it returns -1.
func Geteuid() int {
return syscall.Geteuid()
}
// Getgid returns the numeric group id of the caller.
//
// On non-POSIX systems, it returns -1.
func Getgid() int {
return syscall.Getgid()
}
// Getegid returns the numeric effective group id of the caller.
//
// On non-POSIX systems, it returns -1.
func Getegid() int {
return syscall.Getegid()
}