[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 17/24] bsd-user: move extern to header file
From: |
imp |
Subject: |
[PULL 17/24] bsd-user: move extern to header file |
Date: |
Fri, 23 Apr 2021 14:39:52 -0600 |
From: Warner Losh <imp@bsdimp.com>
extern char **environ has no standard home, so move the declaration from the .c
file to a handy .h file. Since this is a standard, old-school UNIX interface
dating from the 5th edition, it's not quite the same issue that the rule is
supposed to protect against, though.
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
bsd-user/main.c | 1 -
bsd-user/qemu.h | 2 ++
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/bsd-user/main.c b/bsd-user/main.c
index 5958b07e62..a94ab63065 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -48,7 +48,6 @@ unsigned long reserved_va;
static const char *interp_prefix = CONFIG_QEMU_INTERP_PREFIX;
const char *qemu_uname_release;
-extern char **environ;
enum BSDType bsd_type;
/*
diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h
index 3480db890d..4305bd1aed 100644
--- a/bsd-user/qemu.h
+++ b/bsd-user/qemu.h
@@ -27,6 +27,8 @@
#include "exec/user/abitypes.h"
+extern char **environ;
+
enum BSDType {
target_freebsd,
target_netbsd,
--
2.22.1
[PULL 12/24] bsd-user: style tweak: if 0 -> ifdef notyet for code needed in future, imp, 2021/04/23
[PULL 20/24] bsd-user: introduce host_os.h for bsd-specific code and defaults, imp, 2021/04/23
[PULL 13/24] bsd-user: style tweak: if 0 -> ifdef notyet for code needed in future, imp, 2021/04/23