Add tests for the various ways we can ask for the page sizes to ensure
they return a value we expect.
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 45249 Build 42137: arc lint + arc unit
Event Timeline
lib/libc/tests/gen/getpagesize_test.c | ||
---|---|---|
67 | For i386 the element with index 1 is M(4) when we are native i386, and M(2) when we are on amd64. Easiest way to check is sysctl kern.supported_archs. which is "amd64 i386" on amd64, and "i386" otherwise. | |
172 | This is mostly tautological test, because libc getpagesizes() tries AT_PAGESIZES. It probably makes sense to directly find auxv vector right after system environment array, and fetch values from there. |
lib/libc/tests/gen/getpagesize_test.c | ||
---|---|---|
67 | Isn't it only 4MB when PAE is disabled? So i386+PAE (default) -> 2MB I guess we could have a table for each case and check kern.supported_archs and vm.pmap.pae_mode to determine which one to use. | |
209 | A more natural way to do this would be to have this test case call atf_tc_skip() if SKIP_PAGESIZES is defined. Then the test shows up in the list of skipped tests. |
lib/libc/tests/gen/getpagesize_test.c | ||
---|---|---|
67 | Indeed, I do not see a way to check for PAE from userspace without querying kernel. BTW, go detects i386 on amd64, by querying kern.conftxt and looking for machine. I described them that this is too good, but I do not believe they fixed it to use kern.supported_archs. |