Thread returns a process for a given TID of Proc.
(tid int)
| 72 | |
| 73 | // Thread returns a process for a given TID of Proc. |
| 74 | func (proc Proc) Thread(tid int) (Proc, error) { |
| 75 | tfs := FS{fsi.FS(proc.path("task")), proc.fs.isReal} |
| 76 | if _, err := os.Stat(tfs.proc.Path(strconv.Itoa(tid))); err != nil { |
| 77 | return Proc{}, err |
| 78 | } |
| 79 | return Proc{PID: tid, fs: tfs}, nil |
| 80 | } |