file_readv_compat: add a comment to explain limitations

This commit is contained in:
YAMAMOTO Takashi
2025-01-22 12:46:57 +09:00
committed by archer
parent 0ffb0b716e
commit ab9522fd23
2 changed files with 22 additions and 0 deletions
+20
View File
@@ -48,6 +48,26 @@
* Description:
* Emulate readv using file_operation::read.
*
* Unless iovcnt <= 1, this implementation is NOT appropriate for files
* with non-trivial semantics, including:
*
* - Files which might return partial success. (except the EOF)
* (Eg. certain character devices, including tty.)
*
* - Files which need to preserve data boundaries.
* (Eg. datagram sockets)
*
* - Files which need to provide read/write atomicity.
* (Eg. regular files, pipes, fifos. Note that, although NuttX
* doesn't implement the atomicity for regular files as of writing
* this, POSIX requires it.)
*
* - Files with flow-control mechanisms might be confused a bit by
* this implementation. (Eg. TCP socket)
*
* For those kind of files, please consider to implement
* file_operations::readv natively instead of using this function.
*
****************************************************************************/
static ssize_t file_readv_compat(FAR struct file *filep, FAR struct uio *uio)
+2
View File
@@ -48,6 +48,8 @@
* Description:
* Emulate writev using file_operation::write.
*
* Please read the comment on file_readv_compat as well.
*
****************************************************************************/
static ssize_t file_writev_compat(FAR struct file *filep,