STRNCAT(3P)
π STRNCAT(3P) β the POSIX Programmer's Manual glow-up π
okay bestie, quick vibe check before we even start: this page lives in the POSIX Programmer's Manual. That's the friend group. The Linux implementation of this interface may differ (so go consult the corresponding Linux manual page for the tea on Linux behavior), or honestly the interface may not even be implemented on Linux at all. π no cap.
β¨ PROLOG β¨
so basically this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. that's it, that's the prolog, periodt.
πΈ NAME πΈ
strncat β concatenate a string with part of another. it's giving "glue but make it careful". π«Ά
π SYNOPSIS π
#include <string.h>
char *strncat(char *restrict s1, const char *restrict s2, size_t n);
look at her. main character energy. π
π DESCRIPTION π
okay so the functionality described on this reference page is aligned with the ISO C standard. Any conflict between the requirements described here and the ISO C standard is unintentional β like, we're not fighting, we're literally on the same team. This volume of POSIX.1β2017 defers to the ISO C standard.
Now the actual lore: the strncat() function shall append not more than n bytes (a NUL character and bytes that follow it are not appended) from the array pointed to by s2 to the end of the string pointed to by s1. The initial byte of s2 overwrites the NUL character at the end of s1. A terminating NUL character is always appended to the result.
β οΈ bestie listen to me: if copying takes place between objects that overlap, the behavior is undefined. undefined is not a vibe. undefined is the void. do not do it. π
π₯ RETURN VALUE π₯
strncat() shall return s1. that's the whole thing. no return value shall be reserved to indicate an error β she does not do error codes, she does not do drama, she just hands you back s1. π
π ERRORS π
No errors are defined. iconic behavior, honestly. nothing to report, everything's fine. β¨
The following sections are informative. (yes really, the rest of this is just bonus content, not rules β so sip your matcha.) π
π¦ EXAMPLES π¦
None. π literally none. go write your own, i believe in you.
π§ APPLICATION USAGE π§
None. nothing to add, she said what she said.
β RATIONALE β
None. no reasoning given, no explanation needed, she's just like that.
π« FUTURE DIRECTIONS π«
None. the future is bright and also empty. πΈ
π SEE ALSO π
strcat()- The Base Definitions volume of POSIX.1β2017,
<string.h>
go read those too, bestie, they're in the same little family. π«Ά
π COPYRIGHT π
okay legal era, pay attention:
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!! brought to you by IEEE/The Open Group, dated 2017, in the STRNCAT(3P) era πβ¨ mwah, go forth and concatenate responsibly π
π¦ 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