opnsense-src/lib/libc/tests/gen
Conrad Meyer 5a28df2e13 getmntinfo(3): Scale faster, and return sooner
getmntinfo(3) is designed around a relatively static or slow growing set of
current mounts.  It tried to detect a race with somewhat concurrent mount
and re-call getfsstat(2) in that case, looping indefinitely.  It also
allocated space for a single extra mount as slop.

In the case where the user has a large number of mounts and is adding them
at a rapid pace, it fell over.

This patch makes two functional changes:

1. Allocate even more slop.  Double whatever the last getfsstat(2) returned.

2. Abort and return some known results after looping a few times
   (arbitrarily, 3).  If the list is constantly changing, we can't guarantee
   we return a full result to the user at any point anyways.

While here, add very basic functional tests for getmntinfo(3) to the libc
suite.

PR:		221743
Submitted by:	Peter Eriksson <peter AT ifm.liu.se> (earlier version)
Sponsored by:	Dell EMC Isilon
2017-08-25 16:38:21 +00:00
..
execve Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
posix_spawn Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
arc4random_test.c Fix some TAP -> ATF conversion errors 2015-11-09 06:16:38 +00:00
dlopen_empty_test.c This seems like a very trivial bug that should have been squashed a long 2016-01-30 04:16:05 +00:00
fmtcheck_test.c Integrate tools/regression/lib/libc/gen into the FreeBSD test suite 2015-11-09 06:24:11 +00:00
fmtmsg_test.c Integrate tools/regression/lib/libc/gen into the FreeBSD test suite 2015-11-09 06:24:11 +00:00
fnmatch_test.c Integrate tools/regression/lib/libc/gen into the FreeBSD test suite 2015-11-09 06:24:11 +00:00
fnmatch_testcases.h fnmatch(3): Update testcase for r322368. 2017-08-10 17:03:46 +00:00
fpclassify2_test.c Convert tools/regression/lib/libc/stdio/test-fpclassify into an ATF testcase and 2014-11-16 20:29:57 +00:00
ftw_test.c Fix -Wunused warnings 2015-11-15 05:02:41 +00:00
getmntinfo_test.c getmntinfo(3): Scale faster, and return sooner 2017-08-25 16:38:21 +00:00
glob2_test.c libc glob: Avoid pathological exponential behavior 2017-05-03 15:55:29 +00:00
Makefile getmntinfo(3): Scale faster, and return sooner 2017-08-25 16:38:21 +00:00
Makefile.depend DIRDEPS_BUILD: Connect MK_TESTS. 2016-03-09 22:46:01 +00:00
popen_test.c Fix -Wunused warnings 2015-11-15 05:02:41 +00:00
posix_spawn_test.c Integrate tools/regression/lib/libc/gen into the FreeBSD test suite 2015-11-09 06:24:11 +00:00
realpath2_test.c Add tests for some cases in r318298. 2017-05-18 13:49:53 +00:00
test-fnmatch.c Add missing licensing boilerplate to test-fnmatch.c 2015-11-10 11:28:02 +00:00
wordexp_test.c Integrate tools/regression/lib/libc/gen into the FreeBSD test suite 2015-11-09 06:24:11 +00:00