Skip to content
  • Ting-Wei Lan's avatar
    gutils: Check whether getauxval function exists · 295964a3
    Ting-Wei Lan authored and Philip Withnall's avatar Philip Withnall committed
    FreeBSD 12 adds a new header, sys/auxv.h, to declare a function, elf_aux_info,
    for public use, which was considered an internal function in previous releases.
    This new function provides similar functionality with glibc getauxval, which is
    also declared in the same header, but their interfaces are not compatible. Since
    the only usage of sys/auxv.h is in g_check_setuid and FreeBSD already has
    issetugid to provide the required functionality, we fixes the compilation error
    by adding a check for getauxval function to prevent g_check_setuid from calling
    getauxval when sys/auxv.h is found but getauxval is not available.
    
    https://reviews.freebsd.org/D12743
    https://reviews.freebsd.org/rS324815
    295964a3