]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
MFC r230873:
authortrociny <trociny@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 12 Feb 2012 07:52:14 +0000 (07:52 +0000)
committertrociny <trociny@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 12 Feb 2012 07:52:14 +0000 (07:52 +0000)
commit0526116da5aeece1cdbe7bd2aece54f33af669ad
tree1c725630c7f9ed4d6b4308a8910c411201af2b89
parent8638553137d3d6cef52e24d466e738c085f68b58
MFC r230873:

Try to avoid ambiguity when sysctl returns ENOMEM additionally
checking the returned oldlen: when ENOMEM is due to the supplied
buffer being too short the return oldlen is equal to buffer size.

Without this additional check kvm_getprocs() gets stuck in loop if the
returned ENOMEM was due the exceeded memorylocked limit. This is
easily can be observed running `limits -l 1k top'.

Submitted by: Andrey Zonov <andrey zonov org>

git-svn-id: svn://svn.freebsd.org/base/stable/9@231550 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
lib/libkvm/kvm_proc.c