aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2010-08-09 15:19:41 -0500
committerPeter Seebach <seebs@laptop-seebs-net.local>2010-08-11 14:37:59 -0500
commita3075407e06a000a931874af57c33341b6a13da9 (patch)
tree14c7e28fde0dafa022396b90645f44a1f37bb306 /test
parent34dce532d23326be07dd9824159f341223814ba2 (diff)
downloadpseudo-a3075407e06a000a931874af57c33341b6a13da9.tar.gz
pseudo-a3075407e06a000a931874af57c33341b6a13da9.tar.bz2
pseudo-a3075407e06a000a931874af57c33341b6a13da9.zip
Enable execl, execle, execlp, execv, and execvp wrappers
We wrap all of the execs so that we can ensure the environment is properly configured prior to the exec running. handle ... for the new execl* wrappers Add a test for the new execl* ... handling.
Diffstat (limited to 'test')
-rwxr-xr-xtest/test-execl.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/test-execl.sh b/test/test-execl.sh
new file mode 100755
index 0000000..1a1c580
--- /dev/null
+++ b/test/test-execl.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+cat > execl_test.c << EOF
+#include <unistd.h>
+int main() {
+ return execl("/usr/bin/env", "/usr/bin/env", "A=A", "B=B", "C=C", NULL);
+}
+EOF
+
+gcc -o execl_test execl_test.c
+
+./execl_test | grep -q "C=C"
+
+if [ "$?" = "0" ]
+then
+ #echo "Passed."
+ rm -f execl_test execl_test.c
+ exit 0
+fi
+#echo "Failed"
+rm -f execl_test execl_test.c
+exit 1