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
This commit is contained in:
Konstantin Belousov 2022-11-06 06:08:36 +02:00
parent 0303938539
commit 0c6f0c0db7
8 changed files with 3 additions and 13 deletions

View File

@ -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)
{

View File

@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$");
#include "un-namespace.h"
#include "libc_private.h"
extern char **environ;
extern int _DYNAMIC;
#pragma weak _DYNAMIC

View File

@ -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";

View File

@ -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;

View File

@ -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;

View File

@ -401,8 +401,6 @@ __libc_free_tls(void *tcb __unused, size_t tcbsize __unused,
#endif /* PIC */
extern char **environ;
void
_init_tls(void)
{

View File

@ -39,6 +39,8 @@
#include <sys/_types.h>
#include <sys/_pthreadtypes.h>
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.

View File

@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#include <unistd.h>
#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;