1explain_unsetenv_or_die(3) Library Functions Manual explain_unsetenv_or_die(3)
2
3
4
6 explain_unsetenv_or_die - remove an environment variable and report
7 errors
8
10 #include <libexplain/unsetenv.h>
11 void explain_unsetenv_or_die(const char *name);
12 int explain_unsetenv_on_error(const char *name);
13
15 The explain_unsetenv_or_die function is used to call the unsetenv(3)
16 system call. On failure an explanation will be printed to stderr,
17 obtained from the explain_unsetenv(3) function, and then the process
18 terminates by calling exit(EXIT_FAILURE).
19
20 The explain_unsetenv_on_error function is used to call the unsetenv(3)
21 system call. On failure an explanation will be printed to stderr,
22 obtained from the explain_unsetenv(3) function, but still returns to
23 the caller.
24
25 name The name, exactly as to be passed to the unsetenv(3) system
26 call.
27
29 The explain_unsetenv_or_die function only returns on success, see
30 unsetenv(3) for more information. On failure, prints an explanation and
31 exits, it does not return.
32
33 The explain_unsetenv_on_error function always returns the value return
34 by the wrapped unsetenv(3) system call.
35
37 The explain_unsetenv_or_die function is intended to be used in a fash‐
38 ion similar to the following example:
39 explain_unsetenv_or_die(name);
40
42 unsetenv(3)
43 change or add an environment variable
44
45 explain_unsetenv(3)
46 explain unsetenv(3) errors
47
48 exit(2) terminate the calling process
49
51 libexplain version 1.4
52 Copyright (C) 2010 Peter Miller
53
54
55
56 explain_unsetenv_or_die(3)