From owner-svn-src-head@freebsd.org Sun Feb 9 12:12:04 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F1D223767A; Sun, 9 Feb 2020 12:12:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Fnw402tQz44pm; Sun, 9 Feb 2020 12:12:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0CEA60CA; Sun, 9 Feb 2020 12:12:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 019CC31q010250; Sun, 9 Feb 2020 12:12:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 019CC31f010249; Sun, 9 Feb 2020 12:12:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202002091212.019CC31f010249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 9 Feb 2020 12:12:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357696 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 357696 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Feb 2020 12:12:04 -0000 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;