From owner-dev-commits-src-all@freebsd.org Mon Aug 23 09:21:59 2021 Return-Path: Delivered-To: dev-commits-src-all@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 3A6CD667074; Mon, 23 Aug 2021 09:21:59 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GtRZt1Pr8z4RKX; Mon, 23 Aug 2021 09:21:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 11B2E11CA2; Mon, 23 Aug 2021 09:21:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17N9LwdT067236; Mon, 23 Aug 2021 09:21:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17N9LvrH067235; Mon, 23 Aug 2021 09:21:57 GMT (envelope-from git) Date: Mon, 23 Aug 2021 09:21:57 GMT Message-Id: <202108230921.17N9LvrH067235@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 2b5ccf507a7f - stable/13 - rtld: provide private getenv(3) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2b5ccf507a7f7157dc28cf132fe48ec404ff3d5b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2021 09:21:59 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2b5ccf507a7f7157dc28cf132fe48ec404ff3d5b commit 2b5ccf507a7f7157dc28cf132fe48ec404ff3d5b Author: Konstantin Belousov AuthorDate: 2021-08-16 14:02:48 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-23 09:20:56 +0000 rtld: provide private getenv(3) (cherry picked from commit b4b274889145bbc559613b54e7520b95f43e51e6) --- libexec/rtld-elf/rtld-libc/Makefile.inc | 2 +- libexec/rtld-elf/rtld.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld-libc/Makefile.inc b/libexec/rtld-elf/rtld-libc/Makefile.inc index 94d6cbb5b39f..e3c7ee8ca5cf 100644 --- a/libexec/rtld-elf/rtld-libc/Makefile.inc +++ b/libexec/rtld-elf/rtld-libc/Makefile.inc @@ -27,7 +27,7 @@ SRCS+= rtld_libc.c # Now build the remaining files from libc: .PATH: ${LIBC_SRCTOP}/stdlib -SRCS+= reallocf.c realpath.c getenv.c merge.c reallocarray.c +SRCS+= reallocf.c realpath.c merge.c reallocarray.c # TODO: fix merge.c to build with WARNS=6 .if ${COMPILER_TYPE} == "clang" CFLAGS.merge.c+=-Wno-error=null-pointer-arithmetic diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 39c41fe0ed24..8fb99246a4c1 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -6027,6 +6027,12 @@ rtld_strerror(int errnum) return (sys_errlist[errnum]); } +char * +getenv(const char *name) +{ + return (rtld_get_env_val(environ, name, strlen(name))); +} + /* malloc */ void * malloc(size_t nbytes)