1explain_gethostid_or_die(3)Library Functions Manualexplain_gethostid_or_die(3)
2
3
4
6 explain_gethostid_or_die - get the unique identifier of the current
7 host and report errors
8
10 #include <libexplain/gethostid.h>
11 long explain_gethostid_or_die(void);
12 long explain_gethostid_on_error(void);
13
15 The explain_gethostid_or_die function is used to call the gethostid(3)
16 system call. On failure an explanation will be printed to stderr,
17 obtained from the explain_gethostid(3) function, and then the process
18 terminates by calling exit(EXIT_FAILURE).
19
20 The explain_gethostid_on_error function is used to call the geth‐
21 ostid(3) system call. On failure an explanation will be printed to
22 stderr, obtained from the explain_gethostid(3) function, but still
23 returns to the caller.
24
26 The explain_gethostid_or_die function only returns on success, see
27 gethostid(3) for more information. On failure, prints an explanation
28 and exits, it does not return.
29
30 The explain_gethostid_on_error function always returns the value return
31 by the wrapped gethostid(3) system call.
32
34 The explain_gethostid_or_die function is intended to be used in a fash‐
35 ion similar to the following example:
36 long result = explain_gethostid_or_die();
37
39 gethostid(3)
40 get the unique identifier of the current host
41
42 explain_gethostid(3)
43 explain gethostid(3) errors
44
45 exit(2) terminate the calling process
46
48 libexplain version 1.4
49 Copyright (C) 2013 Peter Miller
50
51
52
53 explain_gethostid_or_die(3)