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

Method fileDescriptors

proc.go:291–304  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

289}
290
291func (p Proc) fileDescriptors() ([]string, error) {
292 d, err := os.Open(p.path("fd"))
293 if err != nil {
294 return nil, err
295 }
296 defer d.Close()
297
298 names, err := d.Readdirnames(-1)
299 if err != nil {
300 return nil, fmt.Errorf("%w: Cannot read file: %v: %w", ErrFileRead, names, err)
301 }
302
303 return names, nil
304}
305
306func (p Proc) path(pa ...string) string {
307 return p.fs.proc.Path(append([]string{strconv.Itoa(p.PID)}, pa...)...)

Callers 4

FileDescriptorsMethod · 0.95
FileDescriptorTargetsMethod · 0.95
FileDescriptorsLenMethod · 0.95
FileDescriptorsInfoMethod · 0.95

Calls 1

pathMethod · 0.95

Tested by

no test coverage detected