addseverity(3)
β¨ addseverity(3) β¨
okay bestie, gather round, because we're reading a page from the Library Functions Manual and it's lowkey iconic π
πΈ NAME πΈ
addseverity β introduce new severity classes
π LIBRARY π
Standard C library (libc, -lc)
π SYNOPSIS π
#include <fmtmsg.h>
int addseverity(int severity, const char *s);
π¦ Feature Test Macro Requirements for glibc (see feature_test_macros(7)) π¦
addseverity():
- Since glibc 2.19:
_DEFAULT_SOURCE
- glibc 2.19 and earlier:
_SVID_SOURCE
π DESCRIPTION π
so basically, this function is your little backstage pass to make new severity classes β¨. These are the classes that the severity argument of the fmtmsg(3) function can point at. Like, fmtmsg(3) needs to know what vibe a message is giving, and this is how you teach it.
out of the box? fmtmsg(3) only knows how to print messages for severity 0-4, with the strings (none), HALT, ERROR, WARNING, and INFO. that's it. that's the whole default roster π«Ά
so what this call does is attach the string s you hand it to the numeric value severity you hand it. matching set, slay.
and if s is NULL? then the severity class with the numeric value severity gets removed. bye bestie π
π¨ okay important: you cannot overwrite or remove one of the default severity classes. they're protected. main character privileges, iykyk.
and one more thing β the severity value must be nonnegative. no negatives allowed, periodt.
π₯ RETURN VALUE π₯
- on success you get
MM_OKback π - on error you get
MM_NOTOKback π
possible errors include: out of memory, or an attempt to remove a nonexistent or default severity class.
π ATTRIBUTES π
for an explanation of the terms used in this section, see attributes(7).
- Interface:
addseverity() - Attribute: Thread safety
- Value:
MT-Safe
so yeah, she's MT-Safe, we love a thread-safe queen π
β STANDARDS β
GNU.
πΈ HISTORY πΈ
glibc 2.1. System V.
π NOTES π
you can also add new severity classes by setting the environment variable SEV_LEVEL. two paths to the same glow-up, no cap β¨
π§ SEE ALSO π§
and that's the whole page, bestie!! this was Linux man-pages 6.20, dated 2026-02-08, and she ate, fr fr π ππ¦
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: GPL-1.0-or-later
- Copyright 2002, Walter Harms <walter.harms@informatik.uni-oldenburg.de>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms