elftc_copyfile(3)

elftc_copyfile3

Convenience function to copy data

Usage

#include <libelftc.h>

in

elftc_copyfile(int ifd, int ofd);

Library

library “libelftc”

Overview

The function elftc_copyfile() copies the contents of the file referenced by argument ifd to the file referenced by argument ofd.

The argument ifd should contain a file descriptor opened for reading, with its file offset at the beginning of the file.

The argument ofd should contain a file descriptor opened for writing.

Return values

The elftc_copyfile() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error.

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).

Releases

24 releases since FreeBSD 11.1-RELEASE; the text changed 1 time.

  1. 11.1–12.0
  2. 12.1–16.0

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.