github.com/bananabytelabs/wazero@v0.0.0-20240105073314-54b22a776da8/internal/gojs/custom/process.go (about)

     1  package custom
     2  
     3  const (
     4  	NameProcess          = "process"
     5  	NameProcessArgv0     = "argv0"
     6  	NameProcessCwd       = "cwd"
     7  	NameProcessChdir     = "chdir"
     8  	NameProcessGetuid    = "getuid"
     9  	NameProcessGetgid    = "getgid"
    10  	NameProcessGeteuid   = "geteuid"
    11  	NameProcessGetgroups = "getgroups"
    12  	NameProcessUmask     = "umask"
    13  )
    14  
    15  // ProcessNameSection are the functions defined in the object named NameProcess.
    16  // Results here are those set to the current event object, but effectively are
    17  // results of the host function.
    18  var ProcessNameSection = map[string]*Names{
    19  	NameProcessArgv0: {
    20  		Name:        NameProcessArgv0,
    21  		ParamNames:  []string{},
    22  		ResultNames: []string{"argv0"},
    23  	},
    24  	NameProcessCwd: {
    25  		Name:        NameProcessCwd,
    26  		ParamNames:  []string{},
    27  		ResultNames: []string{"cwd"},
    28  	},
    29  	NameProcessChdir: {
    30  		Name:        NameProcessChdir,
    31  		ParamNames:  []string{"path"},
    32  		ResultNames: []string{"err"},
    33  	},
    34  	NameProcessGetuid: {
    35  		Name:        NameProcessGetuid,
    36  		ParamNames:  []string{},
    37  		ResultNames: []string{"uid"},
    38  	},
    39  	NameProcessGetgid: {
    40  		Name:        NameProcessGetgid,
    41  		ParamNames:  []string{},
    42  		ResultNames: []string{"gid"},
    43  	},
    44  	NameProcessGeteuid: {
    45  		Name:        NameProcessGeteuid,
    46  		ParamNames:  []string{},
    47  		ResultNames: []string{"euid"},
    48  	},
    49  	NameProcessGetgroups: {
    50  		Name:        NameProcessGetgroups,
    51  		ParamNames:  []string{},
    52  		ResultNames: []string{"groups"},
    53  	},
    54  	NameProcessUmask: {
    55  		Name:        NameProcessUmask,
    56  		ParamNames:  []string{"mask"},
    57  		ResultNames: []string{"oldmask"},
    58  	},
    59  }