Răsfoiți Sursa

[posix][mmap] create the mman folder

Meco Man 3 ani în urmă
părinte
comite
15435b6850

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

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

+ 0 - 4
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)
 

+ 11 - 0
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')

+ 1 - 1
components/libc/posix/io/mmap.c → 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)

+ 2 - 2
components/libc/compilers/common/sys/mman.h → 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" {

+ 1 - 1
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;