about summary refs log tree commit diff
path: root/stdlib/tst-putenvmod.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-01-04 07:48:13 +0000
committerUlrich Drepper <drepper@redhat.com>2005-01-04 07:48:13 +0000
commit574b268e7f7a76fe3bcfe389509d9ff91227a860 (patch)
treeee213b8410cd034b34d72858e2488125359dc88f /stdlib/tst-putenvmod.c
parent3fb2606af3b1ab6e6bef7065c65eaca197d73a89 (diff)
downloadglibc-574b268e7f7a76fe3bcfe389509d9ff91227a860.tar.gz
glibc-574b268e7f7a76fe3bcfe389509d9ff91227a860.tar.xz
glibc-574b268e7f7a76fe3bcfe389509d9ff91227a860.zip
Update.
	* stdlib/Makefile: Add rules to build and run tst-putenv.
	* stdlib/tst-putenv.c: New file.
	* stdlib/tst-putenvmod.c: New file.
Diffstat (limited to 'stdlib/tst-putenvmod.c')
-rw-r--r--stdlib/tst-putenvmod.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/stdlib/tst-putenvmod.c b/stdlib/tst-putenvmod.c
new file mode 100644
index 0000000000..7c0c337d3f
--- /dev/null
+++ b/stdlib/tst-putenvmod.c
@@ -0,0 +1,17 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+void
+__attribute ((constructor))
+init (void)
+{
+  puts ("init DSO");
+
+  static char str[] = "SOMETHING_NOBODY_USES=something_else";
+  if (putenv (str) != 0)
+    {
+      puts ("putenv failed");
+      _exit (1);
+    }
+}