OSDN Git Service

LDP: Update original to LDP v3.68
[linuxjm/LDP_man-pages.git] / original / 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 2008-06-14 "GNU" "Linux Programmer's Manual"
10 .SH NAME
11 addseverity \- introduce new severity classes
12 .SH SYNOPSIS
13 .nf
14 .sp
15 .B #include <fmtmsg.h>
16 .sp
17 .BI "int addseverity(int " severity ", const char *" s );
18 .fi
19 .sp
20 .in -4n
21 Feature Test Macro Requirements for glibc (see
22 .BR feature_test_macros (7)):
23 .in
24 .sp
25 .BR addseverity ():
26 _SVID_SOURCE
27 .SH DESCRIPTION
28 This function allows the introduction of new severity classes
29 which can be addressed by the
30 .I severity
31 argument of the
32 .BR fmtmsg (3)
33 function.
34 By default that latter function only knows how to
35 print messages for severity 0-4 (with strings (none), HALT,
36 ERROR, WARNING, INFO).
37 This call attaches the given string
38 .I s
39 to the given value
40 .IR severity .
41 If
42 .I s
43 is NULL, the severity class with the numeric value
44 .I severity
45 is removed.
46 It is not possible to overwrite or remove one of the default
47 severity classes.
48 The severity value must be nonnegative.
49 .SH RETURN VALUE
50 Upon success, the value
51 .B MM_OK
52 is returned.
53 Upon error, the return value is
54 .BR MM_NOTOK .
55 Possible errors include: out of memory, attempt to remove a
56 nonexistent or default severity class.
57 .SH VERSIONS
58 .BR addseverity ()
59 is provided in glibc since version 2.1.
60 .SH CONFORMING TO
61 This function is not specified in the X/Open Portability Guide
62 although the
63 .BR fmtmsg (3)
64 function is.
65 It is available on System V
66 systems.
67 .SH NOTES
68 New severity classes can also be added by setting the environment variable
69 .BR SEV_LEVEL .
70 .SH SEE ALSO
71 .BR fmtmsg (3)
72 .SH COLOPHON
73 This page is part of release 3.68 of the Linux
74 .I man-pages
75 project.
76 A description of the project,
77 information about reporting bugs,
78 and the latest version of this page,
79 can be found at
80 \%http://www.kernel.org/doc/man\-pages/.