Back to index

glibc  2.9
tst-execve1.c
Go to the documentation of this file.
00001 #include <errno.h>
00002 #include <stdio.h>
00003 #include <unistd.h>
00004 
00005 static int
00006 do_test (void)
00007 {
00008   char *argv[] = { (char *) "does-not-exist", NULL };
00009   char *envp[] = { (char *) "FOO=BAR", NULL };
00010   errno = 0;
00011   execve (argv[0], argv, envp);
00012 
00013   if (errno != ENOENT)
00014     {
00015       printf ("errno = %d (%m), expected ENOENT\n", errno);
00016       return 1;
00017     }
00018 
00019   return 0;
00020 }
00021 
00022 #define TEST_FUNCTION do_test ()
00023 #include "../test-skeleton.c"