From 219d1e20f579cda0aac62d90bf926e8a0a9dd688 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Tue, 9 Nov 2021 22:59:31 -0500 Subject: [PATCH] move mmap to src folder --- components/libc/Kconfig | 6 +++++- components/libc/posix/mmap/SConscript | 13 ------------- components/libc/posix/src/SConscript | 3 +++ .../libc/posix/{mmap/posix_mmap.c => src/mmap.c} | 0 components/libc/posix/src/poll.c | 4 ---- components/libc/posix/src/select.c | 4 ---- 6 files changed, 8 insertions(+), 22 deletions(-) delete mode 100644 components/libc/posix/mmap/SConscript rename components/libc/posix/{mmap/posix_mmap.c => src/mmap.c} (100%) diff --git a/components/libc/Kconfig b/components/libc/Kconfig index 7106738b8e..4506001d42 100644 --- a/components/libc/Kconfig +++ b/components/libc/Kconfig @@ -44,16 +44,19 @@ config RT_USING_POSIX if RT_USING_POSIX config RT_USING_POSIX_STDIO - bool "Enable standard IO" + bool "Enable standard I/O" + select RT_USING_DFS select RT_USING_DFS_DEVFS default n config RT_USING_POSIX_POLL bool "Enable poll()" + select RT_USING_DFS default n config RT_USING_POSIX_SELECT bool "Enable select()" + select RT_USING_DFS select RT_USING_POSIX_POLL default n @@ -67,6 +70,7 @@ if RT_USING_POSIX config RT_USING_POSIX_MMAP bool "Enable mmap() API" + select RT_USING_DFS default n config RT_USING_POSIX_TERMIOS diff --git a/components/libc/posix/mmap/SConscript b/components/libc/posix/mmap/SConscript deleted file mode 100644 index fd5b2b953e..0000000000 --- a/components/libc/posix/mmap/SConscript +++ /dev/null @@ -1,13 +0,0 @@ -# RT-Thread building script for component - -from building import * - -cwd = GetCurrentDir() -src = Glob('*.c') + Glob('*.cpp') -CPPPATH = [cwd] - -group = DefineGroup('POSIX', src, - depend = ['RT_USING_DFS', 'RT_USING_POSIX_MMAP'], - CPPPATH = CPPPATH) - -Return('group') diff --git a/components/libc/posix/src/SConscript b/components/libc/posix/src/SConscript index b4454f6a52..0f5d0e9911 100644 --- a/components/libc/posix/src/SConscript +++ b/components/libc/posix/src/SConscript @@ -15,6 +15,9 @@ if GetDepend('RT_USING_POSIX_POLL'): if GetDepend('RT_USING_POSIX_SELECT'): src += ['select.c'] +if GetDepend('RT_USING_POSIX_MMAP'): + src += ['mmap.c'] + group = DefineGroup('POSIX', src, depend = ['RT_USING_POSIX'], CPPPATH = CPPPATH) Return('group') diff --git a/components/libc/posix/mmap/posix_mmap.c b/components/libc/posix/src/mmap.c similarity index 100% rename from components/libc/posix/mmap/posix_mmap.c rename to components/libc/posix/src/mmap.c diff --git a/components/libc/posix/src/poll.c b/components/libc/posix/src/poll.c index 2109fb310b..0c773b306c 100644 --- a/components/libc/posix/src/poll.c +++ b/components/libc/posix/src/poll.c @@ -14,8 +14,6 @@ #include #include -#ifdef RT_USING_POSIX - struct rt_poll_node; struct rt_poll_table @@ -226,5 +224,3 @@ int poll(struct pollfd *fds, nfds_t nfds, int timeout) return num; } - -#endif diff --git a/components/libc/posix/src/select.c b/components/libc/posix/src/select.c index 25cda0f0d1..55d320e921 100644 --- a/components/libc/posix/src/select.c +++ b/components/libc/posix/src/select.c @@ -11,8 +11,6 @@ #include #include -#ifdef RT_USING_POSIX - static void fdszero(fd_set *set, int nfds) { fd_mask *m; @@ -176,5 +174,3 @@ int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struc return ret; } - -#endif