wa-lang.org/wazero@v1.0.2/internal/gojs/testdata/syscall/main.go (about)

     1  package syscall
     2  
     3  import (
     4  	"fmt"
     5  	"log"
     6  	"os"
     7  	"syscall"
     8  )
     9  
    10  func Main() {
    11  	fmt.Printf("syscall.Getpid()=%d\n", syscall.Getpid())
    12  	fmt.Printf("syscall.Getppid()=%d\n", syscall.Getppid())
    13  	fmt.Printf("syscall.Getuid()=%d\n", syscall.Getuid())
    14  	fmt.Printf("syscall.Getgid()=%d\n", syscall.Getgid())
    15  	fmt.Printf("syscall.Geteuid()=%d\n", syscall.Geteuid())
    16  	fmt.Printf("syscall.Umask(0077)=%O\n", syscall.Umask(0o077))
    17  	if g, err := syscall.Getgroups(); err != nil {
    18  		log.Panicln(err)
    19  	} else {
    20  		fmt.Printf("syscall.Getgroups()=%v\n", g)
    21  	}
    22  
    23  	if p, err := os.FindProcess(syscall.Getpid()); err != nil {
    24  		log.Panicln(err)
    25  	} else {
    26  		fmt.Printf("os.FindProcess(pid)=%v\n", p)
    27  	}
    28  }