Skip to contentSkip to conversation

[6484] linux-user: Add generic env variable handling

Qemu-devel Aurelien Jarno 1 participant 1 message Jan 30, 2009 Kbuild

lore
Share & tools
lore
#0 lore raw

Revision: 6484

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6484
Author:   aurel32
Date:     2009-01-30 19:59:17 +0000 (Fri, 30 Jan 2009)

Log Message:
-----------
linux-user: Add generic env variable handling

Adds support for qemu to modify target process environment variables using -E and -U commandline switches. This replaces eventually the -drop-ld-preload flag.

Modified Paths:
--------------
trunk/Makefile.target
trunk/linux-user/main.c

Added Paths:
-----------
trunk/linux-user/envlist.c
trunk/linux-user/envlist.h

Modified: trunk/Makefile.target
===================================================================

Makefile.target +1 -1
@@ -320,7 +320,7 @@
 endif
 
 OBJS= main.o syscall.o strace.o mmap.o signal.o path.o thunk.o \
-      elfload.o linuxload.o uaccess.o
+      elfload.o linuxload.o uaccess.o envlist.o
 LIBS+= $(AIOLIBS)
 ifdef TARGET_HAS_BFLT
 OBJS+= flatload.o

Added: trunk/linux-user/envlist.c
===================================================================

linux-user/envlist.c +247 -0

247 lines not on this page · raw message

Added: trunk/linux-user/envlist.h
===================================================================

linux-user/envlist.h +22 -0
@@ -0,0 +1,22 @@
+#ifndef ENVLIST_H
+#define ENVLIST_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct envlist envlist_t;
+
+extern	envlist_t *envlist_create(void);
+extern	void envlist_free(envlist_t *);
+extern	int envlist_setenv(envlist_t *, const char *);
+extern	int envlist_unsetenv(envlist_t *, const char *);
+extern	int envlist_parse_set(envlist_t *, const char *);
+extern	int envlist_parse_unset(envlist_t *, const char *);
+extern	char **envlist_to_environ(const envlist_t *, size_t *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ENVLIST_H */

Modified: trunk/linux-user/main.c
===================================================================

linux-user/main.c +34 -16

99 lines not on this page · raw message