jlaitine commented on code in PR #8000:
URL: https://github.com/apache/nuttx/pull/8000#discussion_r1059342828
##########
include/nuttx/fs/fs.h:
##########
@@ -206,16 +207,21 @@ struct file_operations
* treated like unions.
*/
- int (*close)(FAR struct file *filep);
- ssize_t (*read)(FAR struct file *filep, FAR char *buffer, size_t buflen);
- ssize_t (*write)(FAR struct file *filep, FAR const char *buffer,
- size_t buflen);
- off_t (*seek)(FAR struct file *filep, off_t offset, int whence);
- int (*ioctl)(FAR struct file *filep, int cmd, unsigned long arg);
+ int (*close)(FAR struct file *filep);
+ ssize_t (*read)(FAR struct file *filep, FAR char *buffer, size_t buflen);
+ ssize_t (*write)(FAR struct file *filep, FAR const char *buffer,
+ size_t buflen);
+ off_t (*seek)(FAR struct file *filep, off_t offset, int whence);
+ int (*ioctl)(FAR struct file *filep, int cmd, unsigned long arg);
+ int (*truncate)(FAR struct file *filep, off_t length);
+ FAR void *(*mmap)(FAR struct file *filep, off_t start, size_t length);
+ int (*munmap)(FAR struct task_group_s *group, FAR struct inode *inode,
Review Comment:
It is possible to add the group parameter of course also to the mmap, if you
can think of some potential use for it. I would think that trying to mmap in
anything else than currently running context would be illegal.
Also, you really need to store the mappings in the group anyways, since the
user side only knows about the virtual address and length of the mapping. Also,
when you store the mappings in the group, you don't need any "context" specific
token; the mmap and unmap are always done in the same currently running
context, except in the case of process deletion.
--
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]