diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-07-16 21:00:11 +0200 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-07-17 13:01:21 +0200 |
commit | 2f0ed531c7f90e1d2d51871c68de7c813c4931c4 (patch) | |
tree | 425b9da15d79048172ccd770c80d84da093a0c8c /pkg/spec/spec_linux.go | |
parent | a449e9a2cf4b73163df75674059de04488cd2706 (diff) | |
download | podman-2f0ed531c7f90e1d2d51871c68de7c813c4931c4.tar.gz podman-2f0ed531c7f90e1d2d51871c68de7c813c4931c4.tar.bz2 podman-2f0ed531c7f90e1d2d51871c68de7c813c4931c4.zip |
spec: rework --ulimit host
it seems enough to not specify any ulimit block to maintain the host
limits.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'pkg/spec/spec_linux.go')
-rw-r--r-- | pkg/spec/spec_linux.go | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/pkg/spec/spec_linux.go b/pkg/spec/spec_linux.go deleted file mode 100644 index fcdfc5c4e..000000000 --- a/pkg/spec/spec_linux.go +++ /dev/null @@ -1,42 +0,0 @@ -//+build linux - -package createconfig - -import ( - "syscall" - - "github.com/pkg/errors" -) - -type systemRlimit struct { - name string - value int -} - -var systemLimits = []systemRlimit{ - {"RLIMIT_AS", syscall.RLIMIT_AS}, - {"RLIMIT_CORE", syscall.RLIMIT_CORE}, - {"RLIMIT_CPU", syscall.RLIMIT_CPU}, - {"RLIMIT_DATA", syscall.RLIMIT_DATA}, - {"RLIMIT_FSIZE", syscall.RLIMIT_FSIZE}, - {"RLIMIT_NOFILE", syscall.RLIMIT_NOFILE}, - {"RLIMIT_STACK", syscall.RLIMIT_STACK}, -} - -func getHostRlimits() ([]systemUlimit, error) { - ret := []systemUlimit{} - for _, i := range systemLimits { - var l syscall.Rlimit - if err := syscall.Getrlimit(i.value, &l); err != nil { - return nil, errors.Wrapf(err, "cannot read limits for %s", i.name) - } - s := systemUlimit{ - name: i.name, - max: l.Max, - cur: l.Cur, - } - ret = append(ret, s) - } - return ret, nil - -} |