diff options
| author | [email protected] <[email protected]> | 2010-11-18 11:31:54 +0000 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2010-11-18 11:31:54 +0000 |
| commit | d9cb84f4840c49993cfbcc80057488c50eae60cb (patch) | |
| tree | 9077055207bb6faa59cd565d37a77aa12e39b53c /examples/libc/env.c | |
| parent | 019b6542012115190cfbde415532c8940cc47500 (diff) | |
add libc testcase.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1061 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'examples/libc/env.c')
| -rw-r--r-- | examples/libc/env.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/examples/libc/env.c b/examples/libc/env.c new file mode 100644 index 0000000000..56f906774f --- /dev/null +++ b/examples/libc/env.c @@ -0,0 +1,18 @@ +/*
+ * env.c
+ *
+ * Created on: 2010-11-17
+ * Author: bernard
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <finsh.h>
+
+int libc_env()
+{
+ printf("PATH=%s\n", getenv("PATH"));
+ putenv("foo=bar");
+ printf("foo=%s\n", getenv("foo"));
+ return 0;
+}
+FINSH_FUNCTION_EXPORT(libc_env, get/set_env test);
|
