Back to index

glibc  2.9
tst-execle1.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   static const char prog[] = "does-not-exist";
00009   const char *env [] = {"FOO=BAR", NULL};
00010   errno = 0;
00011   execle (prog, prog, NULL, env);
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"