KCOPY(9)

πŸ“¦ version 11.0, in nixpkgs unstable

πŸ’« KCOPY(9) πŸ’«

okay bestie, welcome to the Kernel Developer's Manual entry for kcopy β€” it's giving "copy bytes but make it fault-safe" and honestly? iconic. 🫢

✨ NAME ✨

  • kcopy β€” copy data with abort on page fault πŸ’…

🌸 SYNOPSIS 🌸

#include <sys/systm.h>

int
kcopy(const void *src, void *dst, size_t len);

πŸ¦‹ DESCRIPTION πŸ¦‹

So kcopy() copies len bytes from src to dst, and it aborts if a fatal page fault is encountered. no cap, that's the whole vibe check. πŸ’€

And listen β€” kcopy() must save and restore the old fault handler. Why? Because it gets called by uiomove(9), which may be in the path of servicing a non-fatal page fault. like, do not skip that part, bestie, it's literally in the description. πŸŽ€

⭐ RETURN VALUES ⭐

  • 0 β€” success, slay ✨
  • an error number β€” failure, and that's the documented outcome 😭

🌈 SEE ALSO 🌈


and that's the page, bestie! source/version cutie: Debian, dated April 6, 2017 β€” KCOPY(9) said periodt. πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from