]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/valgrind/src/valgrind-3.6.0-svn/none/tests/execve.c
update
[l4.git] / l4 / pkg / valgrind / src / valgrind-3.6.0-svn / none / tests / execve.c
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <unistd.h>
4
5 int main(int argc, char **argv)
6 {
7    if (argc == 1)
8    {
9       // This tests the case where argv and envp are NULL, which is easy to
10       // get wrong because it's an unusual case.
11       if (execve(argv[0], NULL, NULL) < 0)
12       {
13          perror("execve");
14          exit(1);
15       }
16    }
17    
18    exit(0);
19 }