ELFTC_COPYFILE(3)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸ’– NAME

elftc_copyfile β€” convenience function to copy data. literally that's the whole vibe bestie ✨

🫢 LIBRARY

library β€œlibelftc” β€” she lives there, periodt.

✨ SYNOPSIS

okay so here's the synopsis exactly as the page gives it, in and all β€” don't @ me, I don't make the rules:

#include <libelftc.h>

in
elftc_copyfile(int ifd, int ofd);

🌸 DESCRIPTION

okay so elftc_copyfile() copies the contents of the file referenced by argument ifd to the file referenced by argument ofd. that's the main character behavior right there πŸ’…

the argument ifd should contain a file descriptor opened for reading, with its file offset at the beginning of the file. like, beginning-beginning, bestie β€” not mid-file energy πŸŽ€

the argument ofd should contain a file descriptor opened for writing. that's it. that's the setup πŸ¦‹

πŸ”₯ RETURN VALUES

upon successful completion, the value 0 is returned β€” slay, we love a clean win ✨ otherwise, the value -1 is returned and the global variable errno is set to indicate the error. so if it flops, errno is literally there to spill the tea 😭

πŸ’€ ERRORS

the function elftc_copyfile() may fail with any of the errors returned by fstat(2), mmap(2), munmap(2), read(2), write(2), or malloc(3). no cap, those are the ones listed 🫢

πŸ‘‘ SEE ALSO


mwah πŸ’‹ this iconic little page is from Debian, dated December 11, 2011, and it's serving ELFTC_COPYFILE(3) β€” bye bestie, go copy some data responsibly πŸŒˆπŸ’–

πŸ“¦ where this page comes from