jlaitine commented on code in PR #8026:
URL: https://github.com/apache/nuttx/pull/8026#discussion_r1061372433


##########
mm/shm/shmat.c:
##########
@@ -32,11 +32,43 @@
 #include <nuttx/sched.h>
 #include <nuttx/arch.h>
 #include <nuttx/pgalloc.h>
+#include <nuttx/mm/map.h>
 
 #include "shm/shm.h"
 
 #ifdef CONFIG_MM_SHM
 
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+static int munmap_shm(FAR struct task_group_s *group,
+                      FAR struct mm_map_entry_s *map,
+                      FAR void *start,
+                      size_t length)
+{
+  int ret;
+
+  if (group)
+    {
+      /* Normal "unmap", let the shmdt do the work */
+
+      ret = shmdt(start);
+    }
+  else
+    {
+      /* Address environment is being deleted, and the group is not current.
+       * Get shmid from map->priv and only free the pages, don't touch any
+       * mappings
+       */
+
+      shm_destroy(map->priv.i);

Review Comment:
   fixed



-- 
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