MEMCPY(3POSIX)
π MEMCPY(3POSIX) β bestie's guide to copying bytes π
okay so this is a page from the POSIX Programmer's Manual (you know, the 3POSIX section, not the Linux one). hi bestie π«Ά
πΈ PROLOG πΈ
okay so real talk before we get into it: 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 may not even be implemented on Linux. no cap. π
β¨ NAME β¨
memcpy β copy bytes in memory. that's it. that's the girl. π
π SYNOPSIS π
#include <string.h>
void *memcpy(void *restrict s1, const void *restrict s2, size_t n);
look at her. iconic signature. β¨
π¦ DESCRIPTION π¦
so the functionality described on this reference page is aligned with the ISO C standard. and like, if there's any conflict between the requirements described here and the ISO C standard, that conflict is unintentional β this volume of POSIX.1β2017 defers to the ISO C standard. periodt. π―
okay now the actual tea β: the memcpy() function shall copy n bytes from the object pointed to by s2 into the object pointed to by s1.
β οΈ BIG ONE, PAY ATTENTION: if copying takes place between objects that overlap, the behavior is undefined. like, undefined-undefined. do not do this. this is not the vibe. π
π₯ RETURN VALUE π₯
the memcpy() function shall return s1. and listen β no return value is reserved to indicate an error. she doesn't do error codes. she's not that kind of girl. π
π ERRORS π
No errors are defined. literally zero. none. not a single one. π
also fyi: the following sections are informative (so like, they're the extra commentary, not the rules).
π EXAMPLES π
None. she said no examples, we respect it. π
π APPLICATION USAGE π
heads up bestie: the memcpy() function does not check for the overflow of the receiving memory area. so if you hand her a s1 that's too smallβ¦ that's on you, not her. π«Ά please size your buffers. i'm begging. π
β RATIONALE β
None. nothing to explain. she simply is. π
π§ FUTURE DIRECTIONS π§
None. the future is unwritten but memcpy is eternal. β¨
πΈ SEE ALSO πΈ
- The Base Definitions volume of
POSIX.1β2017,<string.h>
go read that one too, iykyk. π
π COPYRIGHT π
okay legal moment, but make it cute:
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 one came from IEEE/The Open Group, dated 2017, and yes the header and footer both just say MEMCPY(3POSIX) π go forth and copy bytes responsibly, and for the love of everything do not overlap them π
β¨
π¦ where this page comes from
- debian bookworm: manpages-posix-dev 2017a-2 Β· Other
- debian trixie: manpages-posix-dev 2017a-2 Β· Other
- ubuntu jammy: manpages-posix-dev 2017a-2 Β· Other
- ubuntu noble: manpages-posix-dev 2017a-2 Β· Other
- ubuntu resolute: manpages-posix-dev 2017a-2build1 Β· Other
- ubuntu stonking: manpages-posix-dev 2017a-2.1 Β· Other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms