mount_setattr.2: ffix
[man-pages.git] / man3 / addseverity.3
blob0a3c8cf5d230277cd1b16eda4c55ee829ecfa1ad
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 2021-03-22 "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 .RS -4
21 Feature Test Macro Requirements for glibc (see
22 .BR feature_test_macros (7)):
23 .RE
24 .PP
25 .BR addseverity ():
26 .nf
27     Since glibc 2.19:
28         _DEFAULT_SOURCE
29     Glibc 2.19 and earlier:
30         _SVID_SOURCE
31 .fi
32 .SH DESCRIPTION
33 This function allows the introduction of new severity classes
34 which can be addressed by the
35 .I severity
36 argument of the
37 .BR fmtmsg (3)
38 function.
39 By default, that function knows only how to
40 print messages for severity 0-4 (with strings (none), HALT,
41 ERROR, WARNING, INFO).
42 This call attaches the given string
43 .I s
44 to the given value
45 .IR severity .
47 .I s
48 is NULL, the severity class with the numeric value
49 .I severity
50 is removed.
51 It is not possible to overwrite or remove one of the default
52 severity classes.
53 The severity value must be nonnegative.
54 .SH RETURN VALUE
55 Upon success, the value
56 .B MM_OK
57 is returned.
58 Upon error, the return value is
59 .BR MM_NOTOK .
60 Possible errors include: out of memory, attempt to remove a
61 nonexistent or default severity class.
62 .SH VERSIONS
63 .BR addseverity ()
64 is provided in glibc since version 2.1.
65 .SH ATTRIBUTES
66 For an explanation of the terms used in this section, see
67 .BR attributes (7).
68 .ad l
69 .nh
70 .TS
71 allbox;
72 lbx lb lb
73 l l l.
74 Interface       Attribute       Value
76 .BR addseverity ()
77 T}      Thread safety   MT-Safe
78 .TE
79 .hy
80 .ad
81 .sp 1
82 .SH CONFORMING TO
83 This function is not specified in the X/Open Portability Guide
84 although the
85 .BR fmtmsg (3)
86 function is.
87 It is available on System V
88 systems.
89 .SH NOTES
90 New severity classes can also be added by setting the environment variable
91 .BR SEV_LEVEL .
92 .SH SEE ALSO
93 .BR fmtmsg (3)