diff options
Diffstat (limited to 'src/libstddjb/fd_read.c')
-rw-r--r-- | src/libstddjb/fd_read.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libstddjb/fd_read.c b/src/libstddjb/fd_read.c new file mode 100644 index 0000000..22a296b --- /dev/null +++ b/src/libstddjb/fd_read.c @@ -0,0 +1,13 @@ +/* ISC license. */ + +#include <unistd.h> +#include <errno.h> +#include <skalibs/allreadwrite.h> + +int fd_read (int fd, char *buf, unsigned int len) +{ + register int r ; + do r = read(fd, buf, len) ; + while ((r == -1) && (errno == EINTR)) ; + return r ; +} |