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)
Dec 9 2024, 10:19 PM
Unknown Object (File)
Nov 20 2024, 4:31 AM
Unknown Object (File)
Oct 28 2024, 8:16 PM
Unknown Object (File)
Oct 21 2024, 8:46 AM
Unknown Object (File)
Oct 21 2024, 6:07 AM
Unknown Object (File)
Oct 21 2024, 3:57 AM
Unknown Object (File)
Oct 5 2024, 8:12 PM
Unknown Object (File)
Sep 18 2024, 7:31 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 Passed
Unit
No Test Coverage
Build Status
Buildable 54579
Build 51468: arc lint + arc unit

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