7 static void prepare (int argc
, char *argv
[]);
8 static int do_test (void);
9 #define PREPARE(argc, argv) prepare (argc, argv)
10 #define TEST_FUNCTION do_test ()
11 #include "../test-skeleton.c"
17 prepare (int argc
, char *argv
[])
21 asprintf (&buf
, "cp %s %n%s-copy", argv
[0], &off
, argv
[0]);
24 puts ("asprintf failed");
27 if (system (buf
) != 0)
29 puts ("system failed");
33 /* Make it not executable. */
35 if (chmod (copy
, 0666) != 0)
37 puts ("chmod failed");
48 char *env
[] = {"FOO=BAR", NULL
};
50 execle (copy
, copy
, NULL
, env
);
54 printf ("errno = %d (%m), expected EACCES\n", errno
);