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
+12
View File
@@ -1,6 +1,18 @@
package os
import "syscall"
type Signal interface {
String() string
Signal() // to distinguish from other Stringers
}
// Getpid returns the process id of the caller, or -1 if unavailable.
func Getpid() int {
return syscall.Getpid()
}
// Getppid returns the process id of the caller's parent, or -1 if unavailable.
func Getppid() int {
return syscall.Getppid()
}