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

Method Thread

thread.go:65–71  ·  view source on GitHub ↗

Thread returns a process for a given PID, TID.

(pid, tid int)

Source from the content-addressed store, hash-verified

63
64// Thread returns a process for a given PID, TID.
65func (fs FS) Thread(pid, tid int) (Proc, error) {
66 taskPath := fs.proc.Path(strconv.Itoa(pid), "task")
67 if _, err := os.Stat(taskPath); err != nil {
68 return Proc{}, err
69 }
70 return Proc{PID: tid, fs: FS{fsi.FS(taskPath), fs.isReal}}, nil
71}
72
73// Thread returns a process for a given TID of Proc.
74func (proc Proc) Thread(tid int) (Proc, error) {

Callers

nothing calls this directly

Calls 2

PathMethod · 0.45
StatMethod · 0.45

Tested by

no test coverage detected