mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-07 12:33:42 +00:00
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:
committed by
Ron Evans
parent
e65592599c
commit
75298bb84b
Vendored
+9
@@ -5,6 +5,7 @@ import (
|
||||
"math/rand"
|
||||
"os"
|
||||
"strings"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -13,6 +14,14 @@ func main() {
|
||||
fmt.Println("stdout:", os.Stdout.Name())
|
||||
fmt.Println("stderr:", os.Stderr.Name())
|
||||
|
||||
// Package syscall, this mostly checks whether the calls don't trigger an error.
|
||||
syscall.Getuid()
|
||||
syscall.Geteuid()
|
||||
syscall.Getgid()
|
||||
syscall.Getegid()
|
||||
syscall.Getpid()
|
||||
syscall.Getppid()
|
||||
|
||||
// package math/rand
|
||||
fmt.Println("pseudorandom number:", rand.Int31())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user