mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
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:
parent
ebfd753408
commit
db4a195744
1 changed files with 1 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue