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, May 22, 9:45 AM
Unknown Object (File)
Tue, May 19, 7:33 AM
Unknown Object (File)
Tue, May 19, 7:26 AM
Unknown Object (File)
Mon, May 18, 3:22 AM
Unknown Object (File)
Mon, May 18, 3:18 AM
Unknown Object (File)
Wed, May 6, 2:56 AM
Unknown Object (File)
Fri, May 1, 12:09 PM
Unknown Object (File)
Thu, Apr 30, 7:12 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