MCPcopy Create free account
hub / github.com/prometheus/procfs / Thread

Method Thread

thread.go:74–80  ·  view source on GitHub ↗

Thread returns a process for a given TID of Proc.

(tid int)

Source from the content-addressed store, hash-verified

72
73// Thread returns a process for a given TID of Proc.
74func (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}

Callers

nothing calls this directly

Calls 3

pathMethod · 0.95
StatMethod · 0.45
PathMethod · 0.45

Tested by

no test coverage detected