#include <cio/io.h>
Functions | |
ssize_t | cio_read (int fd, void *buf, size_t bufsize) |
ssize_t | cio_write (int fd, const void *buf, size_t bufsize) |
ssize_t | cio_sendfile (int out_fd, int in_fd, off_t *offset, size_t count) |
ssize_t cio_read | ( | int | fd, | |
void * | buf, | |||
size_t | bufsize | |||
) |
Read from a file descriptor.
fd | file descriptor | |
buf | buffer | |
bufsize | maximum number of bytes to read |
>0 | the number of bytes read | |
0 | on end-of-file | |
-1 | on error with errno set |
fd
should be in non-blocking moderead(2)
ssize_t cio_sendfile | ( | int | out_fd, | |
int | in_fd, | |||
off_t * | offset, | |||
size_t | count | |||
) |
Transfer data between file descriptors. If offset
is not NULL
, it will be updated according to the number of bytes transferred.
out_fd | target file descriptor | |
in_fd | source file descriptor | |
offset | pointer to file offset or NULL | |
count | maximum number of bytes to transfer |
>=0 | the number of bytes transferred | |
-1 | on error with errno set |
fd
should be in non-blocking modesendfile()
implementation apply also to this functionin_fd
returns EAGAIN
(and there is no other I/O going on), this function busyloopssendfile(2)
ssize_t cio_write | ( | int | fd, | |
const void * | buf, | |||
size_t | bufsize | |||
) |
Write to a file descriptor.
fd | file descriptor | |
buf | buffer | |
bufsize | maximum number of bytes to write |
>0 | the number of bytes written | |
0 | on end-of-file | |
-1 | on error with errno set |
fd
should be in non-blocking modewrite(2)