10 main (int argc
, char **argv
)
12 char template[] = "/tmp/wd_test_XXXXXX";
13 char *tmpdir
= mkdtemp(template);
16 perror ("Couldn't mkdtemp");
20 if (chdir (tmpdir
) != 0)
22 perror ("Couldn't chdir into tmpdir");
27 int dirslen
= PATH_MAX
;
30 /* We don't do any error checking in case some OS fails. */
31 mkdir ("subdir", S_IRWXU
);
33 dirslen
-= strlen ("subdir");
36 /* Make one component inaccessible. */
39 /* Remove the current dir (don't check error, might fail). */
42 execlp ("echo", "echo", "Hello", "World", (char *) NULL
);
43 perror ("Couldn't execlp");