diff options
author | Roland McGrath <roland@gnu.org> | 2000-02-07 02:25:46 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2000-02-07 02:25:46 +0000 |
commit | 96b2a9a9c243bf9d93b3b2737aef62e281000097 (patch) | |
tree | d6b303c32b66f1379fbdf2fc33e817d939fc5f35 /pfinet/glue-include/linux | |
parent | 0a29ea98d32fce9b6ac6a3ed84f65ebc865a253b (diff) |
2000-02-06 Roland McGrath <roland@baalperazim.frob.com>
* glue-include/linux/socket.h (memcpy_fromiovec): Update *IOV to
consume bytes copied from the available buffer.
(memcpy_tokerneliovec): Likewise.
(memcpy_toiovec): Just call memcpy_tokerneliovec.
Diffstat (limited to 'pfinet/glue-include/linux')
-rw-r--r-- | pfinet/glue-include/linux/socket.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/pfinet/glue-include/linux/socket.h b/pfinet/glue-include/linux/socket.h index 12c73bfa..8d5774de 100644 --- a/pfinet/glue-include/linux/socket.h +++ b/pfinet/glue-include/linux/socket.h @@ -90,7 +90,7 @@ struct ucred { }; -extern inline int +extern inline int /* Does not modify IOV. */ memcpy_fromiovecend (unsigned char *kdata, struct iovec *iov, int offset, int len) { @@ -98,25 +98,28 @@ memcpy_fromiovecend (unsigned char *kdata, struct iovec *iov, memcpy (kdata, iov->iov_base + offset, len); return 0; } -extern inline int +extern inline int /* Modifies IOV to consume LEN bytes. */ memcpy_fromiovec (unsigned char *kdata, struct iovec *iov, int len) { assert (len <= iov->iov_len); memcpy (kdata, iov->iov_base, len); + iov->iov_base += len; + iov->iov_len -= len; return 0; } -extern inline int -memcpy_toiovec (struct iovec *iov, unsigned char *kdata, int len) +extern inline void /* Modifies IOV to consume LEN bytes. */ +memcpy_tokerneliovec (struct iovec *iov, unsigned char *kdata, int len) { assert (len <= iov->iov_len); memcpy (iov->iov_base, kdata, len); - return 0; + iov->iov_base += len; + iov->iov_len -= len; } -extern inline void -memcpy_tokerneliovec (struct iovec *iov, unsigned char *kdata, int len) +extern inline int /* Modifies IOV to consume LEN bytes. */ +memcpy_toiovec (struct iovec *iov, unsigned char *kdata, int len) { - assert (len <= iov->iov_len); - memcpy (iov->iov_base, kdata, len); + memcpy_tokerneliovec (iov, kdata, len); + return 0; } extern int csum_partial_copy_fromiovecend(unsigned char *kdata, |