author | Olivier Brunel
<jjk@jjacky.com> 2023-07-29 07:43:57 UTC |
committer | Olivier Brunel
<jjk@jjacky.com> 2023-08-10 12:54:14 UTC |
parent | 5fafae761e4cadd439b9ffbcc82019cd00a94160 |
src/doc/buffer.h/buffer_get.3.md | +2 | -8 |
diff --git a/src/doc/buffer.h/buffer_get.3.md b/src/doc/buffer.h/buffer_get.3.md index fa4ae0d..50845e4 100644 --- a/src/doc/buffer.h/buffer_get.3.md +++ b/src/doc/buffer.h/buffer_get.3.md @@ -30,13 +30,7 @@ int buffer_getvallnofill(buffer *<em>buf</em>, const struct iovec *<em>v</em>, u The `buffer_get`() function will copy into the memory pointed by `dst` of length `dlen` data from the buffer pointed by `buf`. It will try to put as much data as possible, i.e. place `dlen` bytes, filing the buffer if needed. It might copy -less in case of failure to fill the buffer or when end-of-file was reached. - -Note that when an error occurs trying to read from the associated file -descriptor to fill the buffer, it will return the amount of data copied if any -(including from the buffer's internal memory), and only return -1 if an error -occurred whilst no data was copied (i.e. the buffer is empty and no data could -be read from the file descriptor). +less if end-of-file was reached. Any data copied from the buffer is then "removed" from it, i.e. the corresponding space in the buffer's internal memory becomes available. @@ -74,7 +68,7 @@ of length `vlen`. The `buffer_get`() and `buffer_getv`() functions return the size of data read from the buffer (and copied into the specified location(s)) on success, which -may be less than requested. +may be less than requested if end-of-file was reached. Otherwise they return -1 and set `errno` to indicate the error. The `buffer_getall`() and `buffer_getvall`() functions return 1 when all