From nobody Sat Mar 11 22:51:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PYynz2vVYz3wydM; Sat, 11 Mar 2023 22:51:19 +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 4PYynz04Kzz4Hh1; Sat, 11 Mar 2023 22:51:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678575079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=deRXn73oulArjP8zpV0+7q96zpQemzy6ENlN5Wcuj1s=; b=pusCBES47FMSW0VLIjhkAnjNidrAYw3TSwfArbjUiSMZg1/BwNXCBd48PcXVs5k+o99xjK hvMa7HUr5daYaIDVK75TGZ7s2ILiUJ/O346lqWQ0jg2+qzsWuJmYC813K4AumrrwGBaWu8 r4qgxppdV1I9pBEnTAtdq78uoIl7I+6hg1DP2kkIXmUPK9DmCzNY8FMMPFRsg17GZvaoDq UX7J/hHPSev96bT6xmNldtfR2g7a7scdQUDNaDmxZLD9sHoN7ZRgShDmpvVcZ+nyXY9f7w PQEd9K9J59wfgZtdafA5bytSMpF/NYjz3/p1YV4p9Jx5OJesZ7avn3dJpHI+Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678575079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=deRXn73oulArjP8zpV0+7q96zpQemzy6ENlN5Wcuj1s=; b=B7jO4OvmU62BGtsGqzvj/Gcw9g1is2daaCrY9pfBNtf3cCP0nfsIRK1AATTgbS/CWiEds3 lp+c1cBo/0WMaSbCtEoqKhqac5KUSMLGBxq/XBE1J4K8iBWxvInS8QGeeoOf6oNwyq+n/r vmQso8FwB97KyhLqanzSjEqilRwsg0TNOEuY/D85u01vtWbFTtlj2jUEgMp8KrDR3rMX3/ IQAc2sNTH9dRzO7ssPK3u5v3IbiRhbvIxqi1UNoOUY2WcqP5FRiIPP+sNDpVPBYha2D79l Wwg/Z0ne6Gk5/8F0BW9GzeiL5ZqQzgMzJfYX3dyGd4iK5BvtKZ2qMBtxY/NJyA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678575079; a=rsa-sha256; cv=none; b=MaPvLUyf8QqdnkWZKLLv5HBkUp+QaRPpHlOvrEmXCZ43+CKxUiC5l+sKweOctm0uz9GzDF QFV2pedrwVY7bP3WTEjmNG0dXe5jUz5toU1gBMrK/+PCNk2QcAvohWDjrmn4oaK3z8RciL 5wrOq/HBM0UoeXRd5CHAsA5kIpnzf8cwtIiA1Dz7GRclbrHBQQaZURiq0wJeZkByXpbO+H 5VN2mHTPFifToASa2tsCVggm7xtFj2kf20x6o2/ssXLbs95rcmVhNM4sVza3xXGktT/6Ff +ZGsdyY8jRcGpNoUOZP+f+E4q4ru3WgDtkH17RXJjvN0hluw1Z5G1ozflZjHcg== 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 4PYyny6HmfznCs; Sat, 11 Mar 2023 22:51:18 +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 32BMpImE090426; Sat, 11 Mar 2023 22:51:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32BMpIQK090425; Sat, 11 Mar 2023 22:51:18 GMT (envelope-from git) Date: Sat, 11 Mar 2023 22:51:18 GMT Message-Id: <202303112251.32BMpIQK090425@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 0c6f0c0db75e - main - libc: move declaration of 'char **environ' to common private header List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org 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/main X-Git-Reftype: branch X-Git-Commit: 0c6f0c0db75ea5a1e89a68a163fc555bdd7d00f5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0c6f0c0db75ea5a1e89a68a163fc555bdd7d00f5 commit 0c6f0c0db75ea5a1e89a68a163fc555bdd7d00f5 Author: Konstantin Belousov AuthorDate: 2022-11-06 04:08:36 +0000 Commit: Konstantin Belousov CommitDate: 2023-03-11 22:50:04 +0000 libc: move declaration of 'char **environ' to common private header Suggested by: imp Reviewed by: markj Tested by: markj (aarch64) Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Differential revision: https://reviews.freebsd.org/D37220 --- lib/libc/csu/ignore_init.c | 2 -- lib/libc/gen/auxv.c | 1 - lib/libc/gen/exec.c | 2 -- lib/libc/gen/popen.c | 2 -- lib/libc/gen/posix_spawn.c | 2 -- lib/libc/gen/tls.c | 2 -- lib/libc/include/libc_private.h | 2 ++ lib/libc/stdlib/getenv.c | 3 +-- 8 files changed, 3 insertions(+), 13 deletions(-) diff --git a/lib/libc/csu/ignore_init.c b/lib/libc/csu/ignore_init.c index 60c45d7e735f..346409e3f370 100644 --- a/lib/libc/csu/ignore_init.c +++ b/lib/libc/csu/ignore_init.c @@ -117,8 +117,6 @@ handle_static_init(int argc, char **argv, char **env) } } -extern char **environ; - static void handle_argv(int argc, char *argv[], char **env) { diff --git a/lib/libc/gen/auxv.c b/lib/libc/gen/auxv.c index 2f043f8814cf..29b3d6929144 100644 --- a/lib/libc/gen/auxv.c +++ b/lib/libc/gen/auxv.c @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include "libc_private.h" -extern char **environ; extern int _DYNAMIC; #pragma weak _DYNAMIC diff --git a/lib/libc/gen/exec.c b/lib/libc/gen/exec.c index 2c703bb4e73e..f1d69e147719 100644 --- a/lib/libc/gen/exec.c +++ b/lib/libc/gen/exec.c @@ -47,8 +47,6 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include "libc_private.h" -extern char **environ; - static const char execvPe_err_preamble[] = "execvP: "; static const char execvPe_err_trailer[] = ": path too long\n"; diff --git a/lib/libc/gen/popen.c b/lib/libc/gen/popen.c index c5373077f3ae..f0b1a61c2803 100644 --- a/lib/libc/gen/popen.c +++ b/lib/libc/gen/popen.c @@ -53,8 +53,6 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include "libc_private.h" -extern char **environ; - struct pid { SLIST_ENTRY(pid) next; FILE *fp; diff --git a/lib/libc/gen/posix_spawn.c b/lib/libc/gen/posix_spawn.c index 909db9a60a02..7dc0ade5b309 100644 --- a/lib/libc/gen/posix_spawn.c +++ b/lib/libc/gen/posix_spawn.c @@ -45,8 +45,6 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include "libc_private.h" -extern char **environ; - struct __posix_spawnattr { short sa_flags; pid_t sa_pgroup; diff --git a/lib/libc/gen/tls.c b/lib/libc/gen/tls.c index 5ceaf439d839..c0ed0126db6a 100644 --- a/lib/libc/gen/tls.c +++ b/lib/libc/gen/tls.c @@ -401,8 +401,6 @@ __libc_free_tls(void *tcb __unused, size_t tcbsize __unused, #endif /* PIC */ -extern char **environ; - void _init_tls(void) { diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h index 67750d354f22..228eb5c0945f 100644 --- a/lib/libc/include/libc_private.h +++ b/lib/libc/include/libc_private.h @@ -39,6 +39,8 @@ #include #include +extern char **environ; + /* * The kernel doesn't expose PID_MAX to the user space. Save it here * to allow to run a newer world on a pre-1400079 kernel. diff --git a/lib/libc/stdlib/getenv.c b/lib/libc/stdlib/getenv.c index ed0c9efcba6d..7ca27ab710c4 100644 --- a/lib/libc/stdlib/getenv.c +++ b/lib/libc/stdlib/getenv.c @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "un-namespace.h" - +#include "libc_private.h" static const char CorruptEnvFindMsg[] = "environment corrupt; unable to find "; static const char CorruptEnvValueMsg[] = @@ -56,7 +56,6 @@ static const char CorruptEnvValueMsg[] = * intEnviron: Internally-built environ. Exposed via environ during * (re)builds of the environment. */ -extern char **environ; static char **origEnviron; static char **intEnviron = NULL; static int environSize = 0;