1explain_fdopendir_or_die(3)Library Functions Manualexplain_fdopendir_or_die(3)
2
3
4

NAME

6       explain_fdopendir_or_die - open a directory and report errors
7

SYNOPSIS

9       #include <libexplain/fdopendir.h>
10       DIR *explain_fdopendir_or_die(int fildes);
11       DIR *explain_fdopendir_on_error(int fildes);
12

DESCRIPTION

14       The  explain_fdopendir_or_die function is used to call the fdopendir(3)
15       system call. On failure an  explanation  will  be  printed  to  stderr,
16       obtained  from  the explain_fdopendir(3) function, and then the process
17       terminates by calling exit(EXIT_FAILURE).
18
19       The  explain_fdopendir_on_error  function   is   used   to   call   the
20       fdopendir(3)  system call. On failure an explanation will be printed to
21       stderr, obtained from  the  explain_fdopendir(3)  function,  but  still
22       returns to the caller.
23
24       fildes  The  fildes, exactly as to be passed to the fdopendir(3) system
25               call.
26

RETURN VALUE

28       The explain_fdopendir_or_die function  only  returns  on  success,  see
29       fdopendir(3)  for  more  information. On failure, prints an explanation
30       and exits, it does not return.
31
32       The explain_fdopendir_on_error function always returns the value return
33       by the wrapped fdopendir(3) system call.
34

EXAMPLE

36       The explain_fdopendir_or_die function is intended to be used in a fash‐
37       ion similar to the following example:
38              DIR *result = explain_fdopendir_or_die(fildes);
39

SEE ALSO

41       fdopendir(3)
42               open a directory
43
44       explain_fdopendir(3)
45               explain fdopendir(3) errors
46
47       exit(2) terminate the calling process
48
50       libexplain version 1.4
51       Copyright (C) 2009 Peter Miller
52
53
54
55                                                   explain_fdopendir_or_die(3)
Impressum