1explain_setdomainname_or_dieL(i3b)rary Functions Maneuxapllain_setdomainname_or_die(3)
2
3
4
6 explain_setdomainname_or_die - set domain name and report errors
7
9 #include <libexplain/setdomainname.h>
10 void explain_setdomainname_or_die(const char *data, size_t data_size);
11 int explain_setdomainname_on_error(const char *data, size_t data_size);
12
14 The explain_setdomainname_or_die function is used to call the setdo‐
15 mainname(2) system call. On failure an explanation will be printed to
16 stderr, obtained from the explain_setdomainname(3) function, and then
17 the process terminates by calling exit(EXIT_FAILURE).
18
19 The explain_setdomainname_on_error function is used to call the setdo‐
20 mainname(2) system call. On failure an explanation will be printed to
21 stderr, obtained from the explain_setdomainname(3) function, but still
22 returns to the caller.
23
24 data The data, exactly as to be passed to the setdomainname(2) sys‐
25 tem call.
26
27 data_size
28 The data_size, exactly as to be passed to the setdomainname(2)
29 system call.
30
32 The explain_setdomainname_or_die function only returns on success, see
33 setdomainname(2) for more information. On failure, prints an explana‐
34 tion and exits, it does not return.
35
36 The explain_setdomainname_on_error function always returns the value
37 return by the wrapped setdomainname(2) system call.
38
40 The explain_setdomainname_or_die function is intended to be used in a
41 fashion similar to the following example:
42 explain_setdomainname_or_die(data, data_size);
43
45 setdomainname(2)
46 set domain name
47
48 explain_setdomainname(3)
49 explain setdomainname(2) errors
50
51 exit(2) terminate the calling process
52
54 libexplain version 0.40
55 Copyright (C) 2009 Peter Miller
56
57
58
59 explain_setdomainname_or_die(3)