fmtmsg(3) Library Functions Manual fmtmsg(3) fmtmsg - (libc -lc) #include int fmtmsg(long classification, const char *label, int severity, const char *text, const char *action, const char *tag); () classification. stderr MSGVERB. label . 10 14 . text . action . "TO FIX: ". tag . label . . MM_NULLMC (0L) . NO_SEV (0) . MM_NULLLBL MM_NULLTXT MM_NULLACT MM_NULLTAG ((char *) 0) MM_NULLSEV NO_SEV. classification 4 . . MM_PRINT stderr. MM_CONSOLE . MM_PRINT | MM_CONSOLE . : MM_HARD . MM_FIRM . MM_SOFT . : MM_APPL . MM_UTIL . MM_OPSYS . : MM_RECOVER . MM_NRECOV . severity : MM_NOSEV . MM_HALT HALT. MM_ERROR ERROR. MM_WARNING WARNING. MM_INFO INFO. 0 4. addseverity(3) SEV_LEVEL . 4 : MM_OK . MM_NOTOK . MM_NOMSG stderr. MM_NOCON . MSGVERB (" ") stderr. ( .) NULL . "label" "severity" "text" "action" "tag". SEV_LEVEL . . fmtmsg() . SEV_LEVEL SEV_LEVEL=[[:[:...]]] fmtmsg() -- fmtmsg() ( 0-4) . fmtmsg() . . 4. fmtmsg() . . fmtmsg(). attributes(7). +----------------------+------------------------------------+----------+ | | | | +----------------------+------------------------------------+----------+ |fmtmsg() | | glibc >= 2.16: | | | | MT-Safe; | | | | glibc < 2.16: | | | | MT-Unsafe | +----------------------+------------------------------------+----------+ glibc 2.16 fmtmsg() . glibc 2.16 fmtmsg() . fmtmsg() MSGVERB POSIX.1-2008. fmtmsg() System V. POSIX.1-2001 POSIX.1-2008. glibc 2.1. MSGVERB System V. POSIX.1-2001 POSIX.1-2008. SEV_LEVEL System V. System V UnixWare "pfmt() addsev()" "pfmt() vpfmt() lfmt() vlfmt()" . #include #include #include int main(void) { long c = MM_PRINT | MM_SOFT | MM_OPSYS | MM_RECOVER; int err; err = fmtmsg(c, "util-linux:mount", MM_ERROR, "unknown mount option", "See mount(8).", "util-linux:mount:017"); switch (err) { case MM_OK: break; case MM_NOTOK: printf("Nothing printed\n"); break; case MM_NOMSG: printf("Nothing printed to stderr\n"); break; case MM_NOCON: printf("No console output\n"); break; default: printf("Unknown error from fmtmsg()\n"); } exit(EXIT_SUCCESS); } : util-linux:mount: ERROR: unknown mount option TO FIX: See mount(8). util-linux:mount:017 MSGVERB=text:action; export MSGVERB : unknown mount option TO FIX: See mount(8). addseverity(3), perror(3) 3 . . : . 6.18 8 2026 fmtmsg(3)