STRNDUP(3P)

🌸 STRNDUP(3P) β€” POSIX Programmer's Manual 🌸

okay bestie, welcome to the POSIX Programmer's Manual, this is the STRNDUP(3P) page and it is short but we're gonna make it cute πŸ’–


✨ PROLOG ✨

real talk first, bestie, the boring-but-important disclaimer 🫢

This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (so like, go consult the corresponding Linux manual page for the deets on Linux behavior), or the interface may not be implemented on Linux at all. no cap. πŸ’€


πŸŽ€ NAME πŸŽ€

strndup β€” duplicate a specific number of bytes from a string

literally what it says on the tin, she copies some bytes from a string, not all of them, a specific number. main character energy fr fr ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <string.h>

char *strndup(const char *s, size_t size);

that's the whole thing, that's the function signature, she's simple, she's iconic πŸ‘‘


πŸ’… DESCRIPTION πŸ’…

Refer to strdup().

yep. that's it. that's the description. the POSIX girlies said "go read strdup(), it's giving the same energy" and honestly? valid. πŸ’…


okay now the legal bit, and we do not skip the legal bit, that's not the vibe πŸ™ˆ

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. like, the original is the one that counts, periodt.

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. so if something looks cursed, it's probably the conversion's fault, not yours, not mine 🫢

To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


🌈 that's the whole page 🌈

and that's it bestie, strndup said "refer to strdup()" and left, an absolute icon of brevity πŸŽ€

cute sign-off time: this page comes to you from IEEE/The Open Group, dated 2017, and it's the STRNDUP(3P) page in the POSIX Programmer's Manual. stan a 2017 moment ⭐ πŸ¦‹ πŸ’–
πŸ“¦ where this page comes from