Page MenuHomeFreeBSD

getpagesize(3): drop support for non-ELF kernels
ClosedPublic

Authored by brooks on Nov 22 2023, 1:08 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Mar 28, 3:15 AM
Unknown Object (File)
Fri, Mar 27, 8:48 AM
Unknown Object (File)
Mon, Mar 23, 8:18 AM
Unknown Object (File)
Sun, Mar 22, 3:35 PM
Unknown Object (File)
Thu, Mar 5, 3:26 PM
Unknown Object (File)
Thu, Mar 5, 2:12 PM
Unknown Object (File)
Wed, Mar 4, 1:27 AM
Unknown Object (File)
Tue, Mar 3, 6:30 PM
Subscribers
None

Details

Summary

AT_PAGESZ was introduced with ELF support in 1996 (commit
e1743d02cd14069f69a50bb8a6c626c1c6f47ddd) so we can safely count on
being able to use it to get our page size via elf_aux_info(). As such
we don't need a fallback sysctl query.

Save a few bytes of bss by dropping caching as elf_aux_info() runs
in constant time for a given query.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

brooks created this revision.
emaste added inline comments.
lib/libc/gen/getpagesize.c
44–47

maybe simplify by dropping error and just if (_elf_aux_info(AT_PAGESZ, &value, sizeof(value) != 0)...

This revision is now accepted and ready to land.Nov 22 2023, 1:23 AM
This revision now requires review to proceed.Nov 22 2023, 8:32 PM
This revision is now accepted and ready to land.Nov 22 2023, 9:44 PM