浏览代码

增加 RT_USING_POSIX_SELECT RT_USING_POSIX_POLL

Meco Man 3 年之前
父节点
当前提交
664a1d6a75
共有 3 个文件被更改,包括 22 次插入5 次删除
  1. 14 4
      components/libc/Kconfig
  2. 7 1
      components/libc/posix/src/SConscript
  3. 1 0
      components/net/Kconfig

+ 14 - 4
components/libc/Kconfig

@@ -43,18 +43,28 @@ config RT_USING_POSIX
     default n
 
 if RT_USING_POSIX
-    config RT_USING_POSIX_MMAP
-        bool "Enable mmap() API"
+
+    config RT_USING_POSIX_POLL
+        bool "Enable poll()"
         default n
 
-    config RT_USING_POSIX_TERMIOS
-        bool "Enable termios APIs"
+    config RT_USING_POSIX_SELECT
+        bool "Enable select()"
+        select RT_USING_POSIX_POLL
         default n
 
     config RT_USING_POSIX_GETLINE
         bool "Enable getline()/getdelim() APIs"
         default n
 
+    config RT_USING_POSIX_MMAP
+        bool "Enable mmap() API"
+        default n
+
+    config RT_USING_POSIX_TERMIOS
+        bool "Enable termios APIs"
+        default n
+
     config RT_USING_POSIX_AIO
         bool "Enable AIO"
         default n

+ 7 - 1
components/libc/posix/src/SConscript

@@ -2,10 +2,16 @@
 
 from building import *
 
-src     = Glob('*.c')
+src     = ['libc.c','delay.c','unistd.c']
 cwd     = GetCurrentDir()
 CPPPATH = [cwd]
 
+if GetDepend('RT_USING_POSIX_POLL'):
+    src += ['poll.c']
+
+if GetDepend('RT_USING_POSIX_SELECT'):
+    src += ['select.c']
+
 group = DefineGroup('POSIX', src, depend = ['RT_USING_POSIX'], CPPPATH = CPPPATH)
 
 Return('group')

+ 1 - 0
components/net/Kconfig

@@ -42,6 +42,7 @@ config RT_USING_SAL
             bool "Enable BSD socket operated by file system API"
             default n
             select RT_LIBC_USING_FILEIO
+            select RT_USING_POSIX_SELECT
             help
                 Let BSD socket operated by file system API, such as read/write and involveed in select/poll POSIX APIs.