1explain_chdir_or_die(3) Library Functions Manual explain_chdir_or_die(3)
2
3
4
6 explain_chdir_or_die - change working directory and report errors
7
9 #include <libexplain/chdir.h>
10 void explain_chdir_or_die(const char * pathname);
11
13 The explain_chdir_or_die function is used to call the chdir(2) system
14 call. On failure an explanation will be printed to stderr, obtained
15 from explain_chdir(3), and then the process terminates by calling
16 exit(EXIT_FAILURE).
17
18 This function is intended to be used in a fashion similar to the fol‐
19 lowing example:
20 explain_chdir_or_die(pathname);
21
22 pathname
23 The pathname, exactly as to be passed to the chdir(2) system
24 call.
25
26 Returns:
27 This function only returns on success. On failure, prints an
28 explanation and exits.
29
31 libexplain version 1.4
32 Copyright (C) 2008 Peter Miller
33
34
35
36 explain_chdir_or_die(3)