fs/smartfs/smartfs_smart.c: Honor O_APPEND on writes. Also document pwrite() bug/limitation.

This commit is contained in:
Juha Niskanen
2019-11-05 07:32:23 -06:00
committed by Gregory Nutt
parent 3268eb882e
commit a085a0a70b
3 changed files with 22 additions and 2 deletions
+6
View File
@@ -131,6 +131,12 @@ ssize_t file_pwrite(FAR struct file *filep, FAR const void *buf,
* end-of-file condition, or -1 on failure with errno set appropriately.
* See write() return values
*
* Assumptions/Limitations:
* POSIX requires that opening a file with the O_APPEND flag should have no
* effect on the location at which pwrite() writes data. However, on NuttX
* like on Linux, if a file is opened with O_APPEND, pwrite() appends data
* to the end of the file, regardless of the value of offset.
*
****************************************************************************/
ssize_t pwrite(int fd, FAR const void *buf, size_t nbytes, off_t offset)