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_OK back πŸ’–
  • on error you get MM_NOTOK back πŸ’€

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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms