Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153195588
D42708.id130445.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
D42708.id130445.diff
View Options
diff --git a/lib/libc/gen/getpagesize.c b/lib/libc/gen/getpagesize.c
--- a/lib/libc/gen/getpagesize.c
+++ b/lib/libc/gen/getpagesize.c
@@ -29,21 +29,12 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-__SCCSID("@(#)getpagesize.c 8.1 (Berkeley) 6/4/93");
#include <sys/param.h>
-#include <sys/sysctl.h>
-
-#include <errno.h>
-#include <link.h>
-#include <unistd.h>
+#include <sys/auxv.h>
#include "libc_private.h"
/*
- * This is unlikely to change over the running time of any
- * program, so we cache the result to save some syscalls.
- *
* NB: This function may be called from malloc(3) at initialization
* NB: so must not result in a malloc(3) related call!
*/
@@ -51,23 +42,10 @@
int
getpagesize(void)
{
- int mib[2];
- static int value;
- size_t size;
- int error;
-
- if (value != 0)
- return (value);
-
- error = _elf_aux_info(AT_PAGESZ, &value, sizeof(value));
- if (error == 0 && value != 0)
- return (value);
+ int value;
- mib[0] = CTL_HW;
- mib[1] = HW_PAGESIZE;
- size = sizeof value;
- if (sysctl(mib, nitems(mib), &value, &size, NULL, 0) == -1)
- return (PAGE_SIZE);
+ if (_elf_aux_info(AT_PAGESZ, &value, sizeof(value)) != 0)
+ value = PAGE_SIZE;
return (value);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 20, 5:57 PM (19 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31855266
Default Alt Text
D42708.id130445.diff (1 KB)
Attached To
Mode
D42708: getpagesize(3): drop support for non-ELF kernels
Attached
Detach File
Event Timeline
Log In to Comment