Nicholas Nethercote 2047484bc5 Add a comment explaining this test.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8984
2009-01-19 21:33:25 +00:00

20 lines
369 B
C

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(int argc, char **argv)
{
if (argc == 1)
{
// This tests the case where argv and envp are NULL, which is easy to
// get wrong because it's an unusual case.
if (execve(argv[0], NULL, NULL) < 0)
{
perror("execve");
exit(1);
}
}
exit(0);
}