]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/addseverity.3
share/mk/: distcheck: Run 'check' after 'build'
[thirdparty/man-pages.git] / man3 / addseverity.3
1 .\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de)
2 .\"
3 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
4 .\" Distributed under GPL
5 .\" %%%LICENSE_END
6 .\" adapted glibc info page
7 .\"
8 .\" polished a little, aeb
9 .TH ADDSEVERITY 3 2016-03-15 "GNU" "Linux Programmer's Manual"
10 .SH NAME
11 addseverity \- introduce new severity classes
12 .SH SYNOPSIS
13 .nf
14 .PP
15 .B #include <fmtmsg.h>
16 .PP
17 .BI "int addseverity(int " severity ", const char *" s );
18 .fi
19 .PP
20 .in -4n
21 Feature Test Macro Requirements for glibc (see
22 .BR feature_test_macros (7)):
23 .in
24 .PP
25 .BR addseverity ():
26 Since glibc 2.19:
27 _DEFAULT_SOURCE
28 Glibc 2.19 and earlier:
29 _SVID_SOURCE
30 .SH DESCRIPTION
31 This function allows the introduction of new severity classes
32 which can be addressed by the
33 .I severity
34 argument of the
35 .BR fmtmsg (3)
36 function.
37 By default, that function knows only how to
38 print messages for severity 0-4 (with strings (none), HALT,
39 ERROR, WARNING, INFO).
40 This call attaches the given string
41 .I s
42 to the given value
43 .IR severity .
44 If
45 .I s
46 is NULL, the severity class with the numeric value
47 .I severity
48 is removed.
49 It is not possible to overwrite or remove one of the default
50 severity classes.
51 The severity value must be nonnegative.
52 .SH RETURN VALUE
53 Upon success, the value
54 .B MM_OK
55 is returned.
56 Upon error, the return value is
57 .BR MM_NOTOK .
58 Possible errors include: out of memory, attempt to remove a
59 nonexistent or default severity class.
60 .SH VERSIONS
61 .BR addseverity ()
62 is provided in glibc since version 2.1.
63 .SH ATTRIBUTES
64 For an explanation of the terms used in this section, see
65 .BR attributes (7).
66 .TS
67 allbox;
68 lb lb lb
69 l l l.
70 Interface Attribute Value
71 T{
72 .BR addseverity ()
73 T} Thread safety MT-Safe
74 .TE
75 .SH CONFORMING TO
76 This function is not specified in the X/Open Portability Guide
77 although the
78 .BR fmtmsg (3)
79 function is.
80 It is available on System V
81 systems.
82 .SH NOTES
83 New severity classes can also be added by setting the environment variable
84 .BR SEV_LEVEL .
85 .SH SEE ALSO
86 .BR fmtmsg (3)