diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-10-07 15:01:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-07 15:01:27 -0700 |
commit | c817ea1b33966c2f1f089b5c086df8cc45437065 (patch) | |
tree | eccc53908a469d5b71234bebf5957a70a8f9fd3a /pkg/sysinfo/sysinfo.go | |
parent | 589261f275b485d78a6ac1bd7b95578257fc020f (diff) | |
parent | 118cf1fc634ffc63b908d6b082ffc3a53553a6af (diff) | |
download | podman-c817ea1b33966c2f1f089b5c086df8cc45437065.tar.gz podman-c817ea1b33966c2f1f089b5c086df8cc45437065.tar.bz2 podman-c817ea1b33966c2f1f089b5c086df8cc45437065.zip |
Merge pull request #4032 from rhatdan/pids-limit
Setup a reasonable default for pids-limit 4096
Diffstat (limited to 'pkg/sysinfo/sysinfo.go')
-rw-r--r-- | pkg/sysinfo/sysinfo.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/sysinfo/sysinfo.go b/pkg/sysinfo/sysinfo.go index f046de4b1..686f66ce5 100644 --- a/pkg/sysinfo/sysinfo.go +++ b/pkg/sysinfo/sysinfo.go @@ -142,3 +142,12 @@ func popcnt(x uint64) (n byte) { x *= 0x0101010101010101 return byte(x >> 56) } + +// GetDefaultPidsLimit returns the default pids limit to run containers with +func GetDefaultPidsLimit() int64 { + sysInfo := New(true) + if !sysInfo.PidsLimit { + return 0 + } + return 4096 +} |