getpagesize(3) cannot fail.

The sysctl(HW_PAGESIZE) call cannot fail on FreeBSD kernels at least.
And even if it failed for some improbable reason, PAGE_SIZE is a safe
value to return.

Discussed with:	jilles
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2017-04-26 14:25:01 +00:00
parent ebfd753408
commit db4a195744
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=317436

View File

@ -69,7 +69,7 @@ getpagesize(void)
mib[1] = HW_PAGESIZE;
size = sizeof value;
if (sysctl(mib, nitems(mib), &value, &size, NULL, 0) == -1)
return (-1);
return (PAGE_SIZE);
return (value);
}