MCPcopy
hub / github.com/containerd/containerd / SupportsPidFD

Function SupportsPidFD

pkg/sys/pidfd_linux.go:36–49  ·  view source on GitHub ↗

SupportsPidFD returns true if current kernel supports pidfd.

()

Source from the content-addressed store, hash-verified

34
35// SupportsPidFD returns true if current kernel supports pidfd.
36func SupportsPidFD() bool {
37 pidfdSupportedOnce.Do(func() {
38 logger := log.G(context.Background())
39
40 if err := checkPidFD(); err != nil {
41 logger.WithError(err).Error("failed to ensure the kernel supports pidfd")
42
43 pidfdSupported = false
44 return
45 }
46 pidfdSupported = true
47 })
48 return pidfdSupported
49}
50
51func checkPidFD() error {
52 // Linux kernel supports pidfd_open(2) since v5.3.

Callers 3

getUsernsFDFunction · 0.92
UnshareAfterEnterUsernsFunction · 0.85

Calls 3

checkPidFDFunction · 0.85
DoMethod · 0.80
ErrorMethod · 0.45

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…