Index: /branches/libc-0.6/src/libctests/libc/Makefile
===================================================================
--- /branches/libc-0.6/src/libctests/libc/Makefile	(revision 2808)
+++ /branches/libc-0.6/src/libctests/libc/Makefile	(revision 2809)
@@ -62,4 +62,5 @@
 	smoketests/atexit-1.c \
 	smoketests/builtin-1.c \
+	smoketests/execve-1.c \
 	smoketests/fork-1.c \
 	smoketests/fork-2.c \
Index: /branches/libc-0.6/src/libctests/libc/smoketests/execve-1.c
===================================================================
--- /branches/libc-0.6/src/libctests/libc/smoketests/execve-1.c	(revision 2809)
+++ /branches/libc-0.6/src/libctests/libc/smoketests/execve-1.c	(revision 2809)
@@ -0,0 +1,54 @@
+/* $Id: $ */
+/** @file
+ *
+ * Testcase execve-1, just checking that execve() works.
+ *
+ * Copyright (c) 2006 knut st. osmundsen <bird@innotek.de>
+ *
+ *
+ * This file is part of kLIBC.
+ *
+ * kLIBC is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * kLIBC is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with kLIBC; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+
+#include <errno.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdio.h>
+
+
+int main(int argc, char **argv, char **envp)
+{
+    if (argc == 2 && !strcmp(argv[1], "!child!"))
+    {
+        sleep(2);
+        printf("execve-1: SUCCESS - child %d\n", getpid());
+        return 0;
+    }
+
+    /*
+     * The parent.
+     */
+    char *argvChild[3];
+    argvChild[0] = argv[0];
+    argvChild[1] = "!child!";
+    argvChild[2] = NULL;
+    execve(argvChild[0], argvChild, envp);
+    printf("execve-1: FAILURE - execve failed. errno=%d %s\n", errno, strerror(errno));
+    return 1;
+}
+
Index: /trunk/libc/tests/libc/Makefile
===================================================================
--- /trunk/libc/tests/libc/Makefile	(revision 2808)
+++ /trunk/libc/tests/libc/Makefile	(revision 2809)
@@ -62,4 +62,5 @@
 	smoketests/atexit-1.c \
 	smoketests/builtin-1.c \
+	smoketests/execve-1.c \
 	smoketests/fork-1.c \
 	smoketests/fork-2.c \
Index: /trunk/libc/tests/libc/smoketests/execve-1.c
===================================================================
--- /trunk/libc/tests/libc/smoketests/execve-1.c	(revision 2809)
+++ /trunk/libc/tests/libc/smoketests/execve-1.c	(revision 2809)
@@ -0,0 +1,54 @@
+/* $Id: $ */
+/** @file
+ *
+ * Testcase execve-1, just checking that execve() works.
+ *
+ * Copyright (c) 2006 knut st. osmundsen <bird@innotek.de>
+ *
+ *
+ * This file is part of kLIBC.
+ *
+ * kLIBC is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * kLIBC is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with kLIBC; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+
+#include <errno.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdio.h>
+
+
+int main(int argc, char **argv, char **envp)
+{
+    if (argc == 2 && !strcmp(argv[1], "!child!"))
+    {
+        sleep(2);
+        printf("execve-1: SUCCESS - child %d\n", getpid());
+        return 0;
+    }
+
+    /*
+     * The parent.
+     */
+    char *argvChild[3];
+    argvChild[0] = argv[0];
+    argvChild[1] = "!child!";
+    argvChild[2] = NULL;
+    execve(argvChild[0], argvChild, envp);
+    printf("execve-1: FAILURE - execve failed. errno=%d %s\n", errno, strerror(errno));
+    return 1;
+}
+
