JianyuWang0623 commented on code in PR #16490:
URL: https://github.com/apache/nuttx/pull/16490#discussion_r2133877850
##########
fs/vfs/fs_read.c:
##########
@@ -159,11 +159,23 @@ ssize_t file_readv(FAR struct file *filep,
FAR const struct iovec *iov, int iovcnt)
{
FAR struct inode *inode;
- ssize_t ret = -EBADF;
+ ssize_t ret;
DEBUGASSERT(filep);
inode = filep->f_inode;
+ /* Are all iov_base accessible? */
+
+ for (ret = 0; ret < iovcnt; ret++)
+ {
+ if (iov[ret].iov_base == NULL && iov[ret].iov_len != 0)
Review Comment:
Yes, there are iovec provided by user such as `readv()`, thank you!
Referring to Linux, we may need to return an error (EFAULT) when `iov` is
NULL and return zero when `iovcnt` is zero.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]