util: Try to get limits from /proc
util: Try to get limits from /proc

Calling prlimit() requires elevated privileges, specifically
CAP_SYS_RESOURCE, and getrlimit() only works for the current
process which is too limiting for our needs; /proc/$pid/limits,
on the other hand, can be read by any process, so implement
parsing that file as a fallback for when prlimit() fails.

This is useful in containerized environments.

Signed-off-by: Andrea Bolognani <3ada0bee826c753786fdbba72243dfba997094cf@redhat.com>
Reviewed-by: Michal Privoznik <83d82aaba2eed257f4814b0c239c260c4caaadf0@redhat.com>

nertpinx/libvirt,nertpinx/libvirt,crobinso/libvirt,crobinso/libvirt,libvirt/libvirt,zippy2/libvirt,olafhering/libvirt,jfehlig/libvirt,zippy2/libvirt,crobinso/libvirt,olafhering/libvirt,zippy2/libvirt,olafhering/libvirt,nertpinx/libvirt,jfehlig/libvirt,libvirt/libvirt,nertpinx/libvirt,olafhering/libvirt,libvirt/libvirt,crobinso/libvirt,jfehlig/libvirt,jfehlig/libvirt,nertpinx/libvirt,libvirt/libvirt,zippy2/libvirt