CATGETS(3P)
๐ CATGETS(3P) โ the one where you go read a program message ๐
okay bestie, welcome to catgets(3P), straight outta the POSIX Programmer's Manual. pull up a chair, grab a boba, we're doing this. ๐งโจ
๐ธ PROLOG ๐ธ
real talk first, because it matters: this manual page is part of the POSIX Programmer's Manual. the Linux implementation of this interface may differ (so like, go check the corresponding Linux manual page for the deets on Linux behavior), or honestly the interface might just not be implemented on Linux at all. ๐ no cap.
โจ NAME โจ
catgets โ read a program message. that's it, that's the whole vibe. ๐
๐ฆ SYNOPSIS ๐ฆ
#include <nl_types.h>
char *catgets(nl_catd catd, int set_id, int msg_id, const char *s);
look at that signature. iconic. ๐
๐ DESCRIPTION ๐
so the way catgets() works is: it shall attempt to read message msg_id, in set set_id, from the message catalog identified by catd. ๐๏ธ
the catd argument is a message catalog descriptor returned from an earlier call to catopen(). and bestie, listen โ the results are undefined if catd is not a value returned by catopen() for a message catalog still open in the process. like, undefined. not a vibe. don't do it. ๐
the s argument points to a default message string, and that's what catgets() shall return if it cannot retrieve the identified message. so it's giving backup plan energy, and we love a backup plan. ๐ซถ
โ ๏ธ also important: the catgets() function need not be thread-safe. just so you know. ๐ง
๐ RETURN VALUE ๐
if the identified message is retrieved successfully, catgets() shall return a pointer to an internal buffer area containing the null-terminated message string. slay.
if the call is unsuccessful for any reason, s shall be returned, and errno shall be set to indicate the error. ๐ญ that's the tradeoff.
๐ฅ ERRORS ๐ฅ
it shall fail if:
EINTRโ the read operation was terminated due to the receipt of a signal, and no data was transferred. rude of that signal, honestly. ๐ENOMSGโ the message identified byset_idandmsg_idis not in the message catalog. it's just not there bestie, we looked. ๐
it may fail if:
EBADFโ thecatdargument is not a valid message catalog descriptor open for reading. ๐EBADMSGโ the message identified byset_idandmsg_idin the specified message catalog did not satisfy implementation-defined security criteria. security said no. ๐ซEINVALโ the message catalog identified bycatdis corrupted. corrupted!! ๐
the following sections are informative. (aka: cute but optional, iykyk)
๐ EXAMPLES ๐
None. โ literally nothing. the void. ๐ซฅ
๐ธ APPLICATION USAGE ๐ธ
None. โ again, nothing. we stay unbothered. โจ
๐ฆ RATIONALE ๐ฆ
None. โ no thoughts, head empty. ๐ง ๐ซ
โญ FUTURE DIRECTIONS โญ
None. โ the future is a mystery and that's fine. ๐ฎ
๐ SEE ALSO ๐
catclose()catopen()- the Base Definitions volume of POSIX.1โ2017,
<nl_types.h>
go read those too, they're the supporting cast and they ate. ๐ฏโโ๏ธ
๐ COPYRIGHT ๐
okay legal queen moment, we have to do this properly:
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. (it's the main character, we're just the narrator. ๐ )
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!! ๐ this was brought to you by IEEE/The Open Group, dated 2017, signing off with all the love in the world. mwah. ๐๐ฆ๐ธโจ
๐ฆ where this page comes from
- alpine 3.22: man-pages-posix 2017a-r0 ยท custom
- alpine 3.23: man-pages-posix 2017a-r0 ยท custom
- alpine 3.24: man-pages-posix 2017a-r0 ยท custom
- arch rolling: man-pages 6.19-1
- 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-posix 2017a
- opensuse-leap 16.0: man-pages-posix 2017a-160000.4.1 ยท SUSE-IEEE
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms