MEMMOVE(3POSIX)

πŸ’– MEMMOVE(3POSIX) πŸ’–

okay bestie, this is a page from the POSIX Programmer's Manual β€” the <rainbow>memmove</rainbow> glow-up, to be exact. come sit with me, we're gonna get through this together 🫢


🌸 PROLOG 🌸

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.

lowkey important!! the Linux girlies might behave differently, so check the corresponding Linux manual page if that's your whole situation. and sometimes the interface just... isn't there on Linux at all. not a vibe, but it's the truth πŸ’€

✨ NAME ✨

memmove β€” copy bytes in memory with overlapping areas

like it literally just moves bytes around and it does NOT care if the regions overlap. iconic behavior honestly πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

#include <string.h>

void *memmove(void *s1, const void *s2, size_t n);

πŸ’… DESCRIPTION πŸ’…

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. This volume of POSIX.1‐2017 defers to the ISO C standard.

translation bestie: if this page and the ISO C standard ever beef, ISO C wins. no cap.

So here's the tea β˜• β€” the memmove() function shall copy n bytes from the object pointed to by s2 into the object pointed to by s1.

And the way it does that?? it copies as if the n bytes from the object pointed to by s2 are first copied into a temporary array of n bytes that does not overlap the objects pointed to by s1 and s2, and then the n bytes from that temporary array are copied into the object pointed to by s1.

it's giving "imma do it in two steps so the overlap doesn't ruin my whole life" πŸ¦‹ that's literally the entire reason this function exists and it ate πŸ’―


πŸ“ RETURN VALUE πŸ“

The memmove() function shall return s1.

and that's it. no return value is reserved to indicate an error β€” she doesn't do error codes, she's too booked and busy πŸ™ˆ


πŸ’€ ERRORS πŸ’€

No errors are defined.

The following sections are informative.

not me checking the error list and finding absolutely nothing in it 😭 she simply does not have an error era.

🌈 EXAMPLES 🌈

None.


🧚 APPLICATION USAGE 🧚

None.


πŸ‘‘ RATIONALE πŸ‘‘

None.


πŸ”₯ FUTURE DIRECTIONS πŸ”₯

None.


⭐ SEE ALSO ⭐

The Base Definitions volume of POSIX.1‐2017, <string.h>

go read that one next, bestie, it's the source material πŸŽ€


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, periodt πŸ’… this one came to you courtesy of IEEE/The Open Group, dated 2017 β€” so yeah, she's a 2017 girlie and she's still serving. mwah πŸ«ΆπŸ’–βœ¨