Doubt related to iovec/kvec for kernel_sendmsg()

Suraj Choudhari <[email protected]>
Newsgroups org.kernel.vger.lartc
Message-ID <CAGvB2rOZsUiHVWJTELzpTtkZFxyoLBN2hbfv8psvupxXCFmDDA@mail.gmail.com>
Hi,

I have few doubts related to iovec & kvec structures, in particular
related to using these strucutes for sending the data over the socket
using kernel_sendmsg()/sock_sendmsg().

Doubts -
1) Can we pass iovec to kernel_sendmsg() instead of kvecs?  Is it
recommended to use kvec instead of iovec ?

2) What are differences between kvec vs iovec ?
From the definition of these structures, I see that iovec has _user
type, so it may point to a user buffer.  Are there some other
differences between kvec or iovec ?

3) When shall we use kvec instead of iovec ?

4) For iterating the iovecs, I could find one macro -- 'iov_for_each'
which uses iov_iterator.
Is there similar easy way to iterate the kvec ?

Thanks & Regards,
Suraj
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.