xiaoxiang781216 commented on code in PR #8000:
URL: https://github.com/apache/nuttx/pull/8000#discussion_r1059388062


##########
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:
   > Yes, we use an implementation of a linked list, stored into the group, 
which we call "vm_map". I offered an earlier version of this some months ago. 
When the interfaces for these settle, I can come back to that and offer the 
"full" unmap solution in another PR.
   > 
   > IMHO, we shouldn't try to copy linux too much. There everything can be 
buffered/file system cached, and the implementation relies on having full 
virtual memory management. Although it is great for general purpose OS, I don't 
think that it is feasible at this point to try to do all of that for NuttX. 
Instead, let's concentrate for basic needs and keep NuttX as a real-time os :)
   
   Yes, I agree that we just need learn the core design principle from Linux, 
but the detail and implementation may difference dramatically.



-- 
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: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to