1explain_opendir_or_die(3) Library Functions Manual explain_opendir_or_die(3)
2
3
4
6 explain_opendir_or_die - open a directory and report errors
7
9 #include <libexplain/opendir.h>
10 DIR *explain_opendir_or_die(const char *pathname);
11
13 The explain_opendir_or_die function is used to call the opendir(3) sys‐
14 tem call. On failure an explanation will be printed to stderr,
15 obtained from explain_opendir(3), and then the process terminates by
16 calling exit(EXIT_FAILURE).
17
18 This function is intended to be used in a fashion similar to the fol‐
19 lowing example:
20 DIR *dir = explain_opendir_or_die(pathname);
21
22 pathname
23 The pathname, exactly as to be passed to the opendir(3) system
24 call.
25
26 Returns:
27 On success, a pointer to the directory stream. On failure,
28 prints an explanation and exits, does not return.
29
31 opendir(3)
32 open a directory
33
34 explain_opendir(3)
35 explain opendir(3) errors
36
37 exit(2) terminate the calling process
38
40 libexplain version 1.4
41 Copyright (C) 2008 Peter Miller
42
43
44
45 explain_opendir_or_die(3)