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)
Sun, Jul 14, 3:14 PM
Unknown Object (File)
Fri, Jul 5, 8:20 PM
Unknown Object (File)
Fri, Jul 5, 6:47 PM
Unknown Object (File)
Wed, Jun 26, 6:51 PM
Unknown Object (File)
Jun 11 2024, 7:40 PM
Unknown Object (File)
Apr 11 2024, 2:39 PM
Unknown Object (File)
Mar 18 2024, 6:11 AM
Unknown Object (File)
Jan 16 2024, 3:05 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.