ERRMSG(3)

πŸ“¦
version 2022.10.16 Β· 2 versions
, in opensuse-leap 16.0

okay bestie, welcome to ERRMSG(3) from SchilyΒ΄s LIBRARY FUNCTIONS β€” yes, that's the manual name, and we are obsessed βœ¨πŸ’…

🌸 NAME 🌸

  • errmsg() β€” prints error message

✨ SYNOPSIS ✨

errmsg (format, arg1...argn)
char *format;

πŸ’– DESCRIPTION πŸ’–

okay so listen: errmsg() prints on the error output stream a message corresponding to the last error encountered by the system on behalf of the process. no cap, that's the whole assignment πŸ’–

it begins its output with the current program name (as passed to it by exec). and the message can be expanded with additional arguments, in the same form printf() would. iykyk ✨

πŸŽ€ RETURNS πŸŽ€

none β€” literally none, bestie. the returns section ate and left no crumbs 🫢

πŸ¦‹ EXAMPLES πŸ¦‹

vibe check, here's the example exactly:

while (more_args) {
     if (( f = fileopen(arg, "r")) == NULL) {
          errmsg("Skipping file %s.\n", arg);
          continue;
     }
     doit(f)
}

🌈 SEE ALSO 🌈

πŸ‘‘ NOTES πŸ‘‘

errmsg() is identical to comerr() except that instead of exiting, errmsg() prints the error message and returns to the caller. periodt πŸ’… that's the whole note.

xoxo, Joerg Schilling β€” 2022/09/09 β€” from SchilyΒ΄s LIBRARY FUNCTIONS, page ERRMSG(3) πŸ’–πŸŽ€

πŸ“¦ where this page comes from