summaryrefslogtreecommitdiff
path: root/test/unistd/exec-null.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/unistd/exec-null.c')
-rw-r--r--test/unistd/exec-null.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/unistd/exec-null.c b/test/unistd/exec-null.c
new file mode 100644
index 000000000..3df99f3ce
--- /dev/null
+++ b/test/unistd/exec-null.c
@@ -0,0 +1,13 @@
+/* make sure we handle argv[0] == NULL */
+
+#include <unistd.h>
+
+int main(int argc, char *argv[])
+{
+ if (argc == 0)
+ return 0;
+
+ char *exec_argv[1], *exec_envp[1];
+ exec_argv[0] = exec_envp[0] = NULL;
+ return execve("./exec-null", exec_argv, exec_envp);
+}