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)
Fri, Oct 10, 1:37 PM
Unknown Object (File)
Fri, Oct 10, 1:37 PM
Unknown Object (File)
Fri, Oct 10, 1:37 PM
Unknown Object (File)
Fri, Oct 10, 1:37 PM
Unknown Object (File)
Fri, Oct 10, 6:46 AM
Unknown Object (File)
Fri, Sep 26, 1:54 AM
Unknown Object (File)
Thu, Sep 25, 10:12 AM
Unknown Object (File)
Thu, Sep 25, 1:32 AM
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