| 1 |
'\" t |
| 2 |
.\" Copyright 2002, Walter Harms <[email protected]> |
| 3 |
.\" Copyright, the authors of the Linux man-pages project |
| 4 |
.\" |
| 5 |
.\" SPDX-License-Identifier: GPL-1.0-or-later |
| 6 |
.\" |
| 7 |
.TH addseverity 3 2026-02-08 "Linux man-pages 6.18" |
| 8 |
.SH NAME |
| 9 |
addseverity \- introduce new severity classes |
| 10 |
.SH LIBRARY |
| 11 |
Standard C library |
| 12 |
.RI ( libc ,\~ \-lc ) |
| 13 |
.SH SYNOPSIS |
| 14 |
.nf |
| 15 |
.P |
| 16 |
.B #include <fmtmsg.h> |
| 17 |
.P |
| 18 |
.BI "int addseverity(int " severity ", const char *" s ); |
| 19 |
.fi |
| 20 |
.P |
| 21 |
.RS -4 |
| 22 |
Feature Test Macro Requirements for glibc (see |
| 23 |
.BR feature_test_macros (7)): |
| 24 |
.RE |
| 25 |
.P |
| 26 |
.BR addseverity (): |
| 27 |
.nf |
| 28 |
Since glibc 2.19: |
| 29 |
_DEFAULT_SOURCE |
| 30 |
glibc 2.19 and earlier: |
| 31 |
_SVID_SOURCE |
| 32 |
.fi |
| 33 |
.SH DESCRIPTION |
| 34 |
This function allows the introduction of new severity classes |
| 35 |
which can be addressed by the |
| 36 |
.I severity |
| 37 |
argument of the |
| 38 |
.BR fmtmsg (3) |
| 39 |
function. |
| 40 |
By default, that function knows only how to |
| 41 |
print messages for severity 0-4 (with strings (none), HALT, |
| 42 |
ERROR, WARNING, INFO). |
| 43 |
This call attaches the given string |
| 44 |
.I s |
| 45 |
to the given value |
| 46 |
.IR severity . |
| 47 |
If |
| 48 |
.I s |
| 49 |
is NULL, the severity class with the numeric value |
| 50 |
.I severity |
| 51 |
is removed. |
| 52 |
It is not possible to overwrite or remove one of the default |
| 53 |
severity classes. |
| 54 |
The severity value must be nonnegative. |
| 55 |
.SH RETURN VALUE |
| 56 |
Upon success, the value |
| 57 |
.B MM_OK |
| 58 |
is returned. |
| 59 |
Upon error, the return value is |
| 60 |
.BR MM_NOTOK . |
| 61 |
Possible errors include: out of memory, attempt to remove a |
| 62 |
nonexistent or default severity class. |
| 63 |
.SH ATTRIBUTES |
| 64 |
For an explanation of the terms used in this section, see |
| 65 |
.BR attributes (7). |
| 66 |
.TS |
| 67 |
allbox; |
| 68 |
lbx lb lb |
| 69 |
l l l. |
| 70 |
Interface Attribute Value |
| 71 |
T{ |
| 72 |
.na |
| 73 |
.nh |
| 74 |
.BR addseverity () |
| 75 |
T} Thread safety MT-Safe |
| 76 |
.TE |
| 77 |
.SH STANDARDS |
| 78 |
GNU. |
| 79 |
.SH HISTORY |
| 80 |
glibc 2.1. |
| 81 |
System V. |
| 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) |