thughes | 4b9e015 | 2004-06-19 13:02:34 +0000 | [diff] [blame] | 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 | { |
njn | 86728b2 | 2009-01-19 21:33:25 +0000 | [diff] [blame] | 9 | // This tests the case where argv and envp are NULL, which is easy to |
| 10 | // get wrong because it's an unusual case. |
philippe | de7daf4 | 2012-03-11 20:47:41 +0000 | [diff] [blame] | 11 | if (execve("/bin/true", NULL, NULL) < 0) |
thughes | 4b9e015 | 2004-06-19 13:02:34 +0000 | [diff] [blame] | 12 | { |
| 13 | perror("execve"); |
| 14 | exit(1); |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | exit(0); |
| 19 | } |