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
F103239683: D12743.diff
Fri, Nov 22, 1:06 PM
Unknown Object (File)
Thu, Nov 21, 7:21 AM
Unknown Object (File)
Wed, Nov 20, 10:01 AM
Unknown Object (File)
Tue, Nov 19, 12:07 PM
Unknown Object (File)
Tue, Nov 19, 7:42 AM
Unknown Object (File)
Sun, Nov 10, 10:04 PM
Unknown Object (File)
Fri, Nov 8, 11:22 AM
Unknown Object (File)
Fri, Nov 8, 5:59 AM
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.