CmdLine returns the command line of a process.
()
| 128 | |
| 129 | // CmdLine returns the command line of a process. |
| 130 | func (p Proc) CmdLine() ([]string, error) { |
| 131 | data, err := util.ReadFileNoStat(p.path("cmdline")) |
| 132 | if err != nil { |
| 133 | return nil, err |
| 134 | } |
| 135 | |
| 136 | if len(data) < 1 { |
| 137 | return []string{}, nil |
| 138 | } |
| 139 | |
| 140 | return strings.Split(string(bytes.TrimRight(data, "\x00")), "\x00"), nil |
| 141 | } |
| 142 | |
| 143 | // Wchan returns the wchan (wait channel) of a process. |
| 144 | func (p Proc) Wchan() (string, error) { |