LC_MEMSYNC(3)
π LC_MEMSYNC π
okay bestie, welcome to lc_memsync(3) from the Librecast Programmer's Manual β yes that's the manual name, we're keeping it, it's giving official. this one's a libc function, section 3, and it's literally about making two memory areas match each other. slay.
β¨ NAME β¨
lc_memsync β synchronize two memory areas π«Ά
π LIBRARY π
Librecast library (liblibrecast, -llibrecast)
πΈ SYNOPSIS πΈ
#include <librecast/sync.h>
int lc_memsync(void *dst, void *src, const size_t n, q_t *q
lc_stat_t *stats, lc_sync_options_t *opt, int flags);
Compile and link with -llibrecast.
π¦ DESCRIPTION π¦
so the lc_memsync function synchronizes two non-overlapping memory areas of size n bytes using merkle tree comparison, and it overwrites dst with the bytes from src. no cap. that's the whole vibe. π
if q is not NULL, it has to point to a queue q_t structure that was previously initialized with q_init(3). this queue is gonna have jobs enqueued onto it to build the trees. normally you'd use this alongside a threadpool created with q_pool_create(3), where all the threads are calling q_job_seek(3). team effort, bestie. π
if q is NULL, then the creation and destruction of a queue and threadpool gets handled automatically. the code just does it for you, no thoughts required, main character energy. β¨
if stats is not NULL, the transfer statistics get returned in this structure. receipts. π§Ύ
opt is not used, at present, and must be NULL for compatibility with future versions. don't be sneaky and pass something else.
flags is not used, at present, and must be zero for compatibility with future versions. same energy, zero it out. π
π RETURN VALUE π
lc_memsync() returns zero on success. on error, -1 is returned, and errno is set to indicate the error. classic. π
π ERRORS π
EINVALβ invalid argument. the argument said no. π«ENOMEMβ not enough space / cannot allocate memory (POSIX.1-2001). out of memory, it's giving tragedy. π
π SEE ALSO π
q_init(3), q_free(3), q_pool_create(3)
that's a wrap, bestie π«Ά this page came from the LIBRECAST crew, dated 2023-08-02, and it's filed under LC_MEMSYNC(3) β go sync some memory, you iconic thing. πβ¨
π¦ where this page comes from
- debian trixie: liblibrecast-dev 0.9.1-1 Β· GPL-2.0-only OR GPL-3.0-only
- nixos 26.05: librecast 0.11.2
- nixpkgs unstable: librecast 0.11.2
- ubuntu noble: liblibrecast-dev 0.8.0-1.1build1 Β· GPL-2.0-only OR GPL-3.0-only
- ubuntu questing: liblibrecast-dev 0.9.1-1
- ubuntu resolute: liblibrecast-dev 0.11.2-2 Β· GPL-2.0-only OR GPL-3.0-only
- ubuntu stonking: liblibrecast-dev 0.11.2-2build1 Β· GPL-2.0-only OR GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms