Page MenuHomeFreeBSD

Make elf_aux_info() as public libc function.
ClosedPublic

Authored by mmel on Oct 20 2017, 1:48 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 11, 2:39 PM
Unknown Object (File)
Mar 18 2024, 6:11 AM
Unknown Object (File)
Jan 16 2024, 3:05 PM
Unknown Object (File)
Jan 2 2024, 7:22 PM
Unknown Object (File)
Dec 29 2023, 11:14 AM
Unknown Object (File)
Dec 22 2023, 10:58 PM
Unknown Object (File)
Dec 20 2023, 1:08 AM
Unknown Object (File)
Dec 4 2023, 7:11 PM
Subscribers

Details

Summary
  • Teach elf aux vector functions about newly added AT_HWCAP ATHWCAP2 vectors.
  • Export _elf_aux_info() as new public libc function elf_aux_info(3)

The elf_aux_info(3) should be considered as FreeBSD counterpart of glibc
getauxval() with more robust interface.

Note:
We cannot name this new function as getauxval(), with glibc compatible
interface. Some ports autodetect its existence and then expects that all
Linux specific AT_<*> vectors are defined and implemented.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This looks mostly fine, but is not committable because AT_HWCAP2 is not defined.

Does it make sense to include machine/elf.h from auxv.h ? Why not make it a user duty ?

Would be nice to provide some kind of man page.

This revision is now accepted and ready to land.Oct 20 2017, 2:10 PM
sys/sys/auxv.h
35 ↗(On Diff #34180)

You need to brace the function declaration into BEGIN_DECLS/END_DECLS to make it usable for C++.

In D12743#264414, @kib wrote:

Does it make sense to include machine/elf.h from auxv.h ? Why not make it a user duty ?

Imho yes, AT_ values are defined in machine/elf.h so user should include it in (almost) all cases.

Would be nice to provide some kind of man page.

I will ask Ian for man page, this kind of job is significantly out of my skill (even in my native language). My bad I known.

sys/sys/auxv.h
35 ↗(On Diff #34180)

Ahh, yes, sure. I will do it.

This revision was automatically updated to reflect the committed changes.