fmtmsg.h(7POSIX)

πŸ’– fmtmsg.h β€” message display structures πŸ’–

okay bestie, gather round, because we're reading the fmtmsg.h page from the POSIX Programmer's Manual (that's the <fmtmsg.h> header, section 7POSIX, and it's literally all about message display structures). pull up a chair, this one's short but it's got LORE 🫢


🌸 PROLOG 🌸

okay so before we even get into it, real talk: this manual page is part of the POSIX Programmer's Manual. the Linux implementation of this interface may differ β€” so if you're on Linux, go consult the corresponding Linux manual page for details of Linux behavior. OR the interface may just... not be implemented on Linux at all. πŸ’€ yeah. read the room.


✨ NAME ✨

fmtmsg.h β€” message display structures. that's it, that's the whole vibe. it's giving header file with main character energy. πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

#include <fmtmsg.h>

that's the whole thing. include it and you're in. periodt. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so the <fmtmsg.h> header shall define the following symbolic constants, and bestie, we are listing ALL of them, no skips, no crumbs:

  • MM_HARD β€” the source of the condition is hardware. like, the physical stuff. it's giving melted motherboard. πŸ”₯
  • MM_SOFT β€” the source of the condition is software. yes, the code. yes, probably yours. πŸ™ˆ
  • MM_FIRM β€” the source of the condition is firmware. the mysterious in-between. spooky. ✨
  • MM_APPL β€” condition detected by application.
  • MM_UTIL β€” condition detected by utility.
  • MM_OPSYS β€” condition detected by operating system. the OS did this. not you. (it was maybe you.)
  • MM_RECOVER β€” recoverable error. we bounce back. πŸ’ͺ
  • MM_NRECOV β€” non-recoverable error. we do NOT bounce back. 😭
  • MM_HALT β€” error causing application to halt. rip bestie, it's over.
  • MM_ERROR β€” the application has encountered a non-fatal fault.
  • MM_WARNING β€” the application has detected an unusual non-error condition. lowkey suspicious but not an error. 🀨
  • MM_INFO β€” informative message. just chatting. 🌈
  • MM_NOSEV β€” no severity level provided for the message. the severity is... unspecified. mystery box. 🎁
  • MM_PRINT β€” display message on standard error.
  • MM_CONSOLE β€” display message on system console.

okay now the table part, but we're doing it as a list because tables are not the vibe here. the table below indicates the null values and identifiers for fmtmsg() arguments, and the <fmtmsg.h> header shall define the symbolic constants in the Identifier column, which shall have the type indicated in the Type column:

  • argument label β€” type char *, null-value (char*)0, identifier MM_NULLLBL
  • argument severity β€” type int, null-value 0, identifier MM_NULLSEV
  • argument class β€” type long, null-value 0L, identifier MM_NULLMC
  • argument text β€” type char *, null-value (char*)0, identifier MM_NULLTXT
  • argument action β€” type char *, null-value (char*)0, identifier MM_NULLACT
  • argument tag β€” type char *, null-value (char*)0, identifier MM_NULLTAG

and the <fmtmsg.h> header shall also define the following symbolic constants for use as return values for fmtmsg():

  • MM_OK β€” the function succeeded. slay. βœ…
  • MM_NOTOK β€” the function failed completely. not slay. πŸ’€
  • MM_NOMSG β€” the function was unable to generate a message on standard error, but otherwise succeeded. partial win, we take those. 🫢
  • MM_NOCON β€” the function was unable to generate a console message, but otherwise succeeded. also partial win. 🫢

and then, the moment you've been waiting for: the following shall be declared as a function and may also be defined as a macro. a function prototype shall be provided. here it is, verbatim, don't touch it:

int fmtmsg(long, const char *, int,
    const char *, const char *, const char *);

heads up bestie: the following sections are informative. meaning they're not normative requirements, they're just... here. being informative. ✨

πŸ’œ APPLICATION USAGE πŸ’œ

None. nothing. zero. the section is empty. we love a minimalist queen. πŸ™ˆ


🌟 RATIONALE 🌟

None. again nothing. the rationale said "no thoughts, head empty". 😌


🧚 FUTURE DIRECTIONS 🧚

None. no plans. no changes coming. we stay exactly as we are. iconic behavior honestly. πŸ‘‘


πŸ”₯ SEE ALSO πŸ”₯

  • The System Interfaces volume of POSIX.1‐2017, fmtmsg() β€” go read that one too, that's where the actual function lives. iykyk. 🫢

okay legal bestie moment, but it matters, so here we go:

Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


and that's the whole page, bestie!! πŸŽ€πŸ’–βœ¨ this iconic little number comes to you from IEEE/The Open Group, 2017 β€” fmtmsg.h(7POSIX). now go forth and display messages responsibly. love u, bye!! πŸ¦‹πŸ’…πŸŒΈ