Date: Sun, 9 Feb 2020 12:12:03 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357696 - head/lib/libc/gen Message-ID: <202002091212.019CC31f010249@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Sun Feb 9 12:12:03 2020 New Revision: 357696 URL: https://svnweb.freebsd.org/changeset/base/357696 Log: Add AT_BSDFLAGS support to _elf_aux_info(3). Tested by: pho Disscussed with: cem, emaste, jilles Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D12773 Modified: head/lib/libc/gen/auxv.c Modified: head/lib/libc/gen/auxv.c ============================================================================== --- head/lib/libc/gen/auxv.c Sun Feb 9 12:10:37 2020 (r357695) +++ head/lib/libc/gen/auxv.c Sun Feb 9 12:12:03 2020 (r357696) @@ -67,7 +67,7 @@ __init_elf_aux_vector(void) } static pthread_once_t aux_once = PTHREAD_ONCE_INIT; -static int pagesize, osreldate, canary_len, ncpus, pagesizes_len; +static int pagesize, osreldate, canary_len, ncpus, pagesizes_len, bsdflags; static int hwcap_present, hwcap2_present; static char *canary, *pagesizes, *execpath; static void *timekeep; @@ -86,6 +86,10 @@ init_aux(void) for (aux = __elf_aux_vector; aux->a_type != AT_NULL; aux++) { switch (aux->a_type) { + case AT_BSDFLAGS: + bsdflags = aux->a_un.a_val; + break; + case AT_CANARY: canary = (char *)(aux->a_un.a_ptr); break; @@ -323,6 +327,13 @@ _elf_aux_info(int aux, void *buf, int buflen) res = 0; } else res = ENOENT; + } else + res = EINVAL; + break; + case AT_BSDFLAGS: + if (buflen == sizeof(int)) { + *(int *)buf = bsdflags; + res = 0; } else res = EINVAL; break;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202002091212.019CC31f010249>