From 04905aaeffba2bc77866a4056dc3f2020a86bb26 Mon Sep 17 00:00:00 2001
From: Laurent Bercot
- typedef unsigned int alliofunc_t (int fd, char *buf, unsigned int len)
+ typedef size_t alliofunc_t (int fd, char *buf, size_t len)
This is the type of an IO operation that expects all of its
len bytes to be sent or received, and that will loop around a
lower-level IO function until either len bytes have been
@@ -68,7 +64,7 @@ it means that an error has occurred and errno is set.
- int sanitize_read (int r)
+ ssize_t sanitize_read (ssize_t r)
Reading functions such as read() and fd_read return
a positive number when they succeed, -1 when they fail, and 0 when they
read an EOF. No data available on the descriptor when reading in
@@ -87,7 +83,7 @@ on reading.)
- unsigned int allreadwrite (iofunc_t *f, int fd, char *s, unsigned int len)
+ size_t allreadwrite (iofunc_t *f, int fd, char *s, size_t len)
*f must be a basic reading or writing function such as
fd_read or fd_write. allreadwrite() performs
*f on fd, s and len until len
@@ -99,35 +95,35 @@ set errno to EWOULDBLOCK or EAGAIN.
- int fd_read (int fd, char *s, unsigned int len)
+ ssize_t fd_read (int fd, char *s, size_t len)
Safe wrapper around the
read()
function.
- int fd_write (int fd, char const *s, unsigned int len)
+ ssize_t fd_write (int fd, char const *s, size_t len)
Safe wrapper around the
write()
function.
- int fd_recv (int fd, char *s, unsigned int len, unsigned int flags)
+ ssize_t fd_recv (int fd, char *s, size_t len, unsigned int flags)
Safe wrapper around the
recv()
function.
- int fd_send (int fd, char const *s, unsigned int len, unsigned int flags)
+ ssize_t fd_send (int fd, char const *s, size_t len, unsigned int flags)
Safe wrapper around the
send()
function.
- unsigned int allread (int fd, char *s, unsigned int len)
+ size_t allread (int fd, char *s, size_t len)
Equivalent to allreadwrite(&fd_read, fd, s, len)
: attempts
to read len bytes from fd into s, looping around
fd_read() if necessary, until either len bytes are read or
@@ -135,7 +131,7 @@ an error occurs. EOF is reported as EPIPE.
- unsigned int allwrite (int fd, char const *s, unsigned int len)
+ size_t allwrite (int fd, char const *s, size_t len)
Equivalent to allreadwrite((iofunc_t *)&fd_write, fd, s, len)
:
attempts to write len bytes from s to fd, looping
around fd_write() if necessary, until either len bytes are
--
cgit v1.2.3