]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFstable/11 r310506:
authorngie <ngie@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 24 Dec 2016 13:00:19 +0000 (13:00 +0000)
committerngie <ngie@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 24 Dec 2016 13:00:19 +0000 (13:00 +0000)
commit76b81cf23d33a82177809049b4ab39027f38cdcd
treef25d18e665a16fee76239d90fa465c8e486f1d72
parent9f89d2e844488eeb0b38e9172fe6b1b1fbd72b78
MFstable/11 r310506:

MFC r309837:

Change the process limits for RLIMIT_MEMLOCK to RLIM_INFINITY when
executing :mincore_resid

The default process limits in FreeBSD is 64kB for unprivileged users,
which empirically is too low to run the :mincore_resid testcase.

Process limits are inherited, so even though the default limit for
root users is RLIM_INFINITY, the inherited limit with "sudo" with the
default login.conf will be 64kB.

Use setrlimit to set rlim_max for RLIMIT_MEMLOCK to RLIM_INFINITY to
avoid ENOMEM issues when calling mlock to wire the mmap'ed address
space.

setrlimit requires root access to increase rlim_max, so require root
privileges when running the test

Discovered when executing the tests with sudo, e.g.
"sudo kyua test -k /usr/tests/lib/libc/sys/Kyuafile mincore_test"

git-svn-id: svn://svn.freebsd.org/base/stable/10@310507 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
contrib/netbsd-tests/lib/libc/sys/t_mincore.c