summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2021-12-07 15:47:00 -0500
committerBernard Xiong <[email protected]>2021-12-14 06:12:04 +0800
commit15435b68507e0a5b6b90341d7c53945487aaf0de (patch)
tree0f264f5e03383337da634f6efb8b04aacd87557f /components
parentce8085befa161f9940157df6b41190aaf531a5cc (diff)
[posix][mmap] create the mman folder
Diffstat (limited to 'components')
-rw-r--r--components/libc/compilers/common/sys/ioctl.h4
-rw-r--r--components/libc/posix/Kconfig2
-rw-r--r--components/libc/posix/io/SConscript4
-rw-r--r--components/libc/posix/io/mman/SConscript11
-rw-r--r--components/libc/posix/io/mman/mman.c (renamed from components/libc/posix/io/mmap.c)2
-rw-r--r--components/libc/posix/io/mman/sys/mman.h (renamed from components/libc/compilers/common/sys/mman.h)4
-rw-r--r--components/libc/posix/io/poll/poll.c2
7 files changed, 18 insertions, 11 deletions
diff --git a/components/libc/compilers/common/sys/ioctl.h b/components/libc/compilers/common/sys/ioctl.h
index 29ed3a8b84..a1642199b1 100644
--- a/components/libc/compilers/common/sys/ioctl.h
+++ b/components/libc/compilers/common/sys/ioctl.h
@@ -7,8 +7,8 @@
* Date Author Notes
* 2020-09-01 Meco Man First Version
*/
-#ifndef _SYS_IOCTL_H
-#define _SYS_IOCTL_H
+#ifndef __SYS_IOCTL_H__
+#define __SYS_IOCTL_H__
#include <rtconfig.h>
#include <dfs_posix.h>
diff --git a/components/libc/posix/Kconfig b/components/libc/posix/Kconfig
index 52b5fdc948..4534da7118 100644
--- a/components/libc/posix/Kconfig
+++ b/components/libc/posix/Kconfig
@@ -30,7 +30,7 @@ if RT_USING_POSIX_FS
bool "Enable Asynchronous I/O <aio.h>"
default n
- config RT_USING_POSIX_MMAP
+ config RT_USING_POSIX_MMAN
bool "Enable Memory-Mapped I/O <sys/mman.h>"
default n
endif
diff --git a/components/libc/posix/io/SConscript b/components/libc/posix/io/SConscript
index 2a7cd76ded..32654674e8 100644
--- a/components/libc/posix/io/SConscript
+++ b/components/libc/posix/io/SConscript
@@ -18,10 +18,6 @@ if GetDepend('RT_USING_POSIX_SELECT'):
src += ['select.c']
flag = True
-if GetDepend('RT_USING_POSIX_MMAP'):
- src += ['mmap.c']
- flag = True
-
if flag == True:
group = DefineGroup('POSIX', src, depend = [], CPPPATH = CPPPATH)
diff --git a/components/libc/posix/io/mman/SConscript b/components/libc/posix/io/mman/SConscript
new file mode 100644
index 0000000000..7dd096c998
--- /dev/null
+++ b/components/libc/posix/io/mman/SConscript
@@ -0,0 +1,11 @@
+# RT-Thread building script for component
+
+from building import *
+
+cwd = GetCurrentDir()
+src = ['mman.c']
+CPPPATH = [cwd]
+
+group = DefineGroup('POSIX', src, depend = ['RT_USING_POSIX_MMAN'], CPPPATH = CPPPATH)
+
+Return('group')
diff --git a/components/libc/posix/io/mmap.c b/components/libc/posix/io/mman/mman.c
index e68b82e640..827f2cbb14 100644
--- a/components/libc/posix/io/mmap.c
+++ b/components/libc/posix/io/mman/mman.c
@@ -14,7 +14,7 @@
#include <rtthread.h>
#include <dfs_posix.h>
-#include <sys/mman.h>
+#include "sys/mman.h"
void *mmap(void *addr, size_t length, int prot, int flags,
int fd, off_t offset)
diff --git a/components/libc/compilers/common/sys/mman.h b/components/libc/posix/io/mman/sys/mman.h
index 2da2ddf716..a730f33b6b 100644
--- a/components/libc/compilers/common/sys/mman.h
+++ b/components/libc/posix/io/mman/sys/mman.h
@@ -8,8 +8,8 @@
* 2017/11/30 Bernard The first version.
*/
-#ifndef _SYS_MMAN_H
-#define _SYS_MMAN_H
+#ifndef __SYS_MMAN_H__
+#define __SYS_MMAN_H__
#ifdef __cplusplus
extern "C" {
diff --git a/components/libc/posix/io/poll/poll.c b/components/libc/posix/io/poll/poll.c
index 0c773b306c..a1500ba109 100644
--- a/components/libc/posix/io/poll/poll.c
+++ b/components/libc/posix/io/poll/poll.c
@@ -12,7 +12,7 @@
#include <rthw.h>
#include <rtthread.h>
#include <dfs_file.h>
-#include <poll.h>
+#include "poll.h"
struct rt_poll_node;