diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-03-08 09:39:11 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-03-08 09:39:11 +0000 |
commit | 04905aaeffba2bc77866a4056dc3f2020a86bb26 (patch) | |
tree | f66439aeb6cfe05268824ac890169e5cd306f3f3 /doc/libstddjb/allreadwrite.html | |
parent | a5079576ae9007fb1ca7ebcc911b5fb035cd2d06 (diff) | |
download | skalibs-04905aaeffba2bc77866a4056dc3f2020a86bb26.tar.xz |
Update documentation for the types change, with some extra fixes
Also remove --enable-replace-libc from configure
Diffstat (limited to 'doc/libstddjb/allreadwrite.html')
-rw-r--r-- | doc/libstddjb/allreadwrite.html | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/doc/libstddjb/allreadwrite.html b/doc/libstddjb/allreadwrite.html index f71ce09..2ab8d8f 100644 --- a/doc/libstddjb/allreadwrite.html +++ b/doc/libstddjb/allreadwrite.html @@ -44,19 +44,15 @@ use higher-level APIs such as <a href="buffer.html>buffer</a> and <h2> Function types </h2> <p> -<code> typedef int iofunc_t (int fd, char *buf, unsigned int len) </code> <br /> +<code> typedef ssize_t iofunc_t (int fd, char *buf, size_t len) </code> <br /> This is the simplified type of IO functions such as <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/read.html">read()</a> and <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/write.html">write()</a>. -Unless your system's <tt>int</tt> is 64-bit, skalibs - which has been -optimized for small systems - does not support IO operations of more than -2 GB of data, for the sake of simplicity. In any case, it's always -possible to send data in several smaller chunks. </p> <p> -<code> typedef unsigned int alliofunc_t (int fd, char *buf, unsigned int len) </code> <br /> +<code> typedef size_t alliofunc_t (int fd, char *buf, size_t len) </code> <br /> This is the type of an IO operation that expects <em>all</em> of its <em>len</em> bytes to be sent or received, and that will loop around a lower-level IO function until either <em>len</em> bytes have been @@ -68,7 +64,7 @@ it means that an error has occurred and <tt>errno</tt> is set. <h2> Functions </h2> <p> -<code> int sanitize_read (int r) </code> <br /> +<code> ssize_t sanitize_read (ssize_t r) </code> <br /> Reading functions such as <tt>read()</tt> and <tt>fd_read</tt> 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.) </p> <p> -<code> unsigned int allreadwrite (iofunc_t *f, int fd, char *s, unsigned int len) </code> <br /> +<code> size_t allreadwrite (iofunc_t *f, int fd, char *s, size_t len) </code> <br /> *<em>f</em> must be a basic reading or writing function such as <tt>fd_read</tt> or <tt>fd_write</tt>. <tt>allreadwrite()</tt> performs *<em>f</em> on <em>fd</em>, <em>s</em> and <em>len</em> until <em>len</em> @@ -99,35 +95,35 @@ set errno to EWOULDBLOCK or EAGAIN. </p> <p> -<code> int fd_read (int fd, char *s, unsigned int len) </code> <br /> +<code> ssize_t fd_read (int fd, char *s, size_t len) </code> <br /> <a href="safewrappers.html">Safe wrapper</a> around the <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/read.html">read()</a> function. </p> <p> -<code> int fd_write (int fd, char const *s, unsigned int len) </code> <br /> +<code> ssize_t fd_write (int fd, char const *s, size_t len) </code> <br /> <a href="safewrappers.html">Safe wrapper</a> around the <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/write.html">write()</a> function. </p> <p> -<code> int fd_recv (int fd, char *s, unsigned int len, unsigned int flags) </code> <br /> +<code> ssize_t fd_recv (int fd, char *s, size_t len, unsigned int flags) </code> <br /> <a href="safewrappers.html">Safe wrapper</a> around the <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/recv.html">recv()</a> function. </p> <p> -<code> int fd_send (int fd, char const *s, unsigned int len, unsigned int flags) </code> <br /> +<code> ssize_t fd_send (int fd, char const *s, size_t len, unsigned int flags) </code> <br /> <a href="safewrappers.html">Safe wrapper</a> around the <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/send.html">send()</a> function. </p> <p> -<code> unsigned int allread (int fd, char *s, unsigned int len) </code> <br /> +<code> size_t allread (int fd, char *s, size_t len) </code> <br /> Equivalent to <code> allreadwrite(&fd_read, fd, s, len) </code>: attempts to read <em>len</em> bytes from <em>fd</em> into <em>s</em>, looping around <tt>fd_read()</tt> if necessary, until either <em>len</em> bytes are read or @@ -135,7 +131,7 @@ an error occurs. EOF is reported as EPIPE. </p> <p> -<code> unsigned int allwrite (int fd, char const *s, unsigned int len) </code> <br /> +<code> size_t allwrite (int fd, char const *s, size_t len) </code> <br /> Equivalent to <code> allreadwrite((iofunc_t *)&fd_write, fd, s, len) </code>: attempts to write <em>len</em> bytes from <em>s</em> to <em>fd</em>, looping around <tt>fd_write()</tt> if necessary, until either <em>len</em> bytes are |