MCPcopy Create free account
hub / github.com/apache/nuttx / unload_module

Function unload_module

binfmt/binfmt_unloadmodule.c:71–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69 ****************************************************************************/
70
71int unload_module(FAR struct binary_s *binp)
72{
73 int ret;
74
75 if (binp)
76 {
77 /* Perform any format-specific unload operations */
78
79 if (binp->unload)
80 {
81 ret = binp->unload(binp);
82 if (ret < 0)
83 {
84 berr("binp->unload() failed: %d\n", ret);
85 return ret;
86 }
87 }
88
89 /* Unmap mapped address spaces */
90
91 if (binp->mapped)
92 {
93 binfo("Unmapping address space: %p\n", binp->mapped);
94
95 file_munmap(binp->mapped, binp->mapsize);
96 }
97
98 /* Notice that the address environment is not destroyed. This should
99 * happen automatically when the task exits.
100 */
101 }
102
103 return OK;
104}
105
106#endif /* CONFIG_BINFMT_DISABLE */

Callers 2

binfmt_exitFunction · 0.85
exec_internalFunction · 0.85

Calls 1

file_munmapFunction · 0.85

Tested by

no test coverage detected