Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102876387
D42707.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D42707.id.diff
View Options
diff --git a/lib/libc/gen/getpagesizes.c b/lib/libc/gen/getpagesizes.c
--- a/lib/libc/gen/getpagesizes.c
+++ b/lib/libc/gen/getpagesizes.c
@@ -27,11 +27,8 @@
*/
#include <sys/param.h>
-#include <sys/mman.h>
-#include <sys/sysctl.h>
-
-#include <errno.h>
-#include <link.h>
+#include <sys/auxv.h>
+#include <sys/errno.h>
#include "libc_private.h"
@@ -52,24 +49,18 @@
{
static u_long ps[MAXPAGESIZES];
static int nops;
- size_t size;
- int error, i;
+ int i;
if (nelem < 0 || (nelem > 0 && pagesize == NULL)) {
errno = EINVAL;
return (-1);
}
- /* Cache the result of the sysctl(2). */
+ /* Cache the result */
if (nops == 0) {
- error = _elf_aux_info(AT_PAGESIZES, ps, sizeof(ps));
- size = sizeof(ps);
- if (error != 0 || ps[0] == 0) {
- if (sysctlbyname("hw.pagesizes", ps, &size, NULL, 0)
- == -1)
- return (-1);
- }
+ if (_elf_aux_info(AT_PAGESIZES, ps, sizeof(ps)) != 0)
+ ps[0] = PAGE_SIZE;
/* Count the number of page sizes that are supported. */
- nops = size / sizeof(ps[0]);
+ nops = nitems(ps);
while (nops > 0 && ps[nops - 1] == 0)
nops--;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 19, 8:00 AM (17 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14712882
Default Alt Text
D42707.id.diff (1 KB)
Attached To
Mode
D42707: getpagesizes(3): drop support for kernels before 9.0
Attached
Detach File
Event Timeline
Log In to Comment