limb 0.2.0

2024-01-09

fd_read(3)
limb manual
fd_read(3)

NAME

fd_read, fd_readv - safe wrappers for reading files

SYNOPSIS

#include <limb/allreadwrite.h>
ssize_t fd_read(int fd, char *dst, size_t dlen)
ssize_t fd_readv(int fd, const struct iovec *v, unsigned n)

DESCRIPTION

The fd_read() function is a safe wrapper around read(3), i.e. it cannot be interrupted by signals. More precisely, if read(3) fails with EINTR it is automatically called again until it succeeds or fails with another error.

The fd_readv() function is similar, but around readv(3).

RETURN VALUE

These functions return the number of bytes read from fd and copied into memory on success. Otherwise they return -1 and set errno to indicate the error.

ERRORS

The fd_read() and fd_readv() functions may fail and set errno for any of the errors described for read(3) and readv(3), respectively, except for EINTR.

limb 0.1.0
2023-07-24
fd_read(3)