libite 2.6.1
fsendfile.c File Reference
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>

Go to the source code of this file.

Functions

ssize_t fsendfile (FILE *src, FILE *dst, size_t len)
 

Detailed Description

Author
Tobias Waldekranz
Date
2013

Definition in file fsendfile.c.

Function Documentation

◆ fsendfile()

ssize_t fsendfile ( FILE * src,
FILE * dst,
size_t len )

Copy data between file streams.

Parameters
srcSource stream
dstDestination stream
lenNumber of bytes to copy

The dst argument may be NULL, in which case len bytes are read and discarded from src. This can be useful for streams where seeking is not permitted. Additionally, len may be the special value zero (0), in which case fsendfile() copies until EOF is seen on src.

Returns
The number of bytes copied. If an error is detected -1 is returned and errno will be set accordingly.

Definition at line 51 of file fsendfile.c.