1explain_getgrent_or_die(3) Library Functions Manual explain_getgrent_or_die(3)
2
3
4
6 explain_getgrent_or_die - get group file entry and report errors
7
9 #include <libexplain/getgrent.h>
10 struct group *explain_getgrent_or_die(void);
11 struct group *explain_getgrent_on_error(void);
12
14 The explain_getgrent_or_die function is used to call the getgrent(3)
15 system call. On failure an explanation will be printed to stderr,
16 obtained from the explain_getgrent(3) function, and then the process
17 terminates by calling exit(EXIT_FAILURE).
18
19 The explain_getgrent_on_error function is used to call the getgrent(3)
20 system call. On failure an explanation will be printed to stderr,
21 obtained from the explain_getgrent(3) function, but still returns to
22 the caller.
23
25 The explain_getgrent_or_die function only returns on success, see get‐
26 grent(3) for more information. On failure, prints an explanation and
27 exits, it does not return.
28
29 The explain_getgrent_on_error function always returns the value return
30 by the wrapped getgrent(3) system call.
31
33 The explain_getgrent_or_die function is intended to be used in a fash‐
34 ion similar to the following example:
35 struct group *result = explain_getgrent_or_die();
36
38 getgrent(3)
39 get group file entry
40
41 explain_getgrent(3)
42 explain getgrent(3) errors
43
44 exit(2) terminate the calling process
45
47 libexplain version 1.4
48 Copyright (C) 2013 Peter Miller
49
50
51
52 explain_getgrent_or_die(3)