/*
 * sendfile
 */

#include <fcntl.h>
#include <sys/sendfile.h>
#include <unistd.h>

int main(void)
{
	int in = open("/etc/hostname", O_RDONLY);
	int out = open("/dev/null", O_WRONLY);
	if (in >= 0 && out >= 0) {
		off_t off = 0;
		sendfile(out, in, &off, 64);
	}
	if (in >= 0) close(in);
	if (out >= 0) close(out);
	return 0;
}
