1ADDSEVERITY(3) Linux Programmer's Manual ADDSEVERITY(3)
2
3
4
6 addseverity - introduce new severity classes
7
9 #include <fmtmsg.h>
10
11 int addseverity(int severity, const char *s);
12
13 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
14
15 addseverity():
16 Since glibc 2.19:
17 _DEFAULT_SOURCE
18 Glibc 2.19 and earlier:
19 _SVID_SOURCE
20
22 This function allows the introduction of new severity classes which can
23 be addressed by the severity argument of the fmtmsg(3) function. By
24 default, that function knows only how to print messages for severity
25 0-4 (with strings (none), HALT, ERROR, WARNING, INFO). This call at‐
26 taches the given string s to the given value severity. If s is NULL,
27 the severity class with the numeric value severity is removed. It is
28 not possible to overwrite or remove one of the default severity
29 classes. The severity value must be nonnegative.
30
32 Upon success, the value MM_OK is returned. Upon error, the return
33 value is MM_NOTOK. Possible errors include: out of memory, attempt to
34 remove a nonexistent or default severity class.
35
37 addseverity() is provided in glibc since version 2.1.
38
40 For an explanation of the terms used in this section, see at‐
41 tributes(7).
42
43 ┌────────────────────────────────────────────┬───────────────┬─────────┐
44 │Interface │ Attribute │ Value │
45 ├────────────────────────────────────────────┼───────────────┼─────────┤
46 │addseverity() │ Thread safety │ MT-Safe │
47 └────────────────────────────────────────────┴───────────────┴─────────┘
48
50 This function is not specified in the X/Open Portability Guide although
51 the fmtmsg(3) function is. It is available on System V systems.
52
54 New severity classes can also be added by setting the environment vari‐
55 able SEV_LEVEL.
56
58 fmtmsg(3)
59
61 This page is part of release 5.12 of the Linux man-pages project. A
62 description of the project, information about reporting bugs, and the
63 latest version of this page, can be found at
64 https://www.kernel.org/doc/man-pages/.
65
66
67
68GNU 2021-03-22 ADDSEVERITY(3)