mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 06:42:32 +08:00
fs/munmap: export the symbols to avoid build break on C++ syntax
base/metrics/persistent_memory_allocator.cc:1009:18: error: expected id-expression before ‘-’ token
1009 | int result = ::munmap(memory, size);
| ^~~~~~
Change-Id: I24e55c18d09553d3acc341a27063d01489d905ec
Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
+2
-2
@@ -33,10 +33,10 @@
|
||||
#
|
||||
############################################################################
|
||||
|
||||
CSRCS += fs_mmap.c
|
||||
CSRCS += fs_mmap.c fs_munmap.c
|
||||
|
||||
ifeq ($(CONFIG_FS_RAMMAP),y)
|
||||
CSRCS += fs_munmap.c fs_rammap.c
|
||||
CSRCS += fs_rammap.c
|
||||
endif
|
||||
|
||||
# Include MMAP build support
|
||||
|
||||
+8
-6
@@ -52,8 +52,6 @@
|
||||
#include "inode/inode.h"
|
||||
#include "fs_rammap.h"
|
||||
|
||||
#ifdef CONFIG_FS_RAMMAP
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@@ -110,6 +108,7 @@
|
||||
|
||||
int munmap(FAR void *start, size_t length)
|
||||
{
|
||||
#ifdef CONFIG_FS_RAMMAP
|
||||
FAR struct fs_rammap_s *prev;
|
||||
FAR struct fs_rammap_s *curr;
|
||||
FAR void *newaddr;
|
||||
@@ -129,7 +128,8 @@ int munmap(FAR void *start, size_t length)
|
||||
|
||||
/* Search the list of regions */
|
||||
|
||||
for (prev = NULL, curr = g_rammaps.head; curr; prev = curr, curr = curr->flink)
|
||||
for (prev = NULL, curr = g_rammaps.head; curr;
|
||||
prev = curr, curr = curr->flink)
|
||||
{
|
||||
/* Does this region include any part of the specified range? */
|
||||
|
||||
@@ -196,7 +196,8 @@ int munmap(FAR void *start, size_t length)
|
||||
|
||||
else
|
||||
{
|
||||
newaddr = kumm_realloc(curr->addr, sizeof(struct fs_rammap_s) + length);
|
||||
newaddr = kumm_realloc(curr->addr,
|
||||
sizeof(struct fs_rammap_s) + length);
|
||||
DEBUGASSERT(newaddr == (FAR void *)(curr->addr));
|
||||
UNUSED(newaddr); /* May not be used */
|
||||
curr->length = length;
|
||||
@@ -211,6 +212,7 @@ errout_with_semaphore:
|
||||
errout:
|
||||
set_errno(errcode);
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
#else
|
||||
return OK;
|
||||
#endif /* CONFIG_FS_RAMMAP */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user