diff options
| author | Sherman <[email protected]> | 2021-12-14 16:19:48 +0800 |
|---|---|---|
| committer | Sherman <[email protected]> | 2021-12-14 16:19:48 +0800 |
| commit | c3e20fda8b28d5d849d2ebfcc53251ebb0dce6f1 (patch) | |
| tree | be70cb698895e46b05d0025b153585905bcebd84 /components/libc | |
| parent | a42cc7f5d0b8177b4546d7d19983145770a78308 (diff) | |
| parent | 92cf02a34d0c7e86cb75689c906629e0849e3855 (diff) | |
Merge branch 'master' of github.com:ShermanShao/rt-thread
Diffstat (limited to 'components/libc')
| -rw-r--r-- | components/libc/compilers/common/sys/ioctl.h | 4 | ||||
| -rw-r--r-- | components/libc/posix/Kconfig | 4 | ||||
| -rw-r--r-- | components/libc/posix/io/SConscript | 4 | ||||
| -rw-r--r-- | components/libc/posix/io/mman/SConscript | 11 | ||||
| -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/SConscript | 7 | ||||
| -rw-r--r-- | components/libc/posix/io/poll/poll.c | 2 | ||||
| -rw-r--r-- | components/libc/posix/ipc/Kconfig | 17 | ||||
| -rw-r--r-- | components/libc/posix/ipc/sys/ipc.h | 15 | ||||
| -rw-r--r-- | components/libc/posix/ipc/sys/msg.h | 15 | ||||
| -rw-r--r-- | components/libc/posix/ipc/sys/sem.h | 15 | ||||
| -rw-r--r-- | components/libc/posix/ipc/sys/shm.h | 15 |
13 files changed, 102 insertions, 13 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 db83269dd0..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 @@ -55,4 +55,6 @@ if RT_USING_PTHREADS default 8 endif +source "$RTT_DIR/components/libc/posix/ipc/Kconfig" + endmenu 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/SConscript b/components/libc/posix/io/poll/SConscript index 47f1722ed3..7d82ade035 100644 --- a/components/libc/posix/io/poll/SConscript +++ b/components/libc/posix/io/poll/SConscript @@ -3,9 +3,12 @@ from building import * cwd = GetCurrentDir() -src = ['poll.c'] +src = [] CPPPATH = [cwd] -group = DefineGroup('POSIX', src, depend = ['RT_USING_POSIX_POLL'], CPPPATH = CPPPATH) +if GetDepend('RT_USING_POSIX_POLL'): + src += ['poll.c'] + +group = DefineGroup('POSIX', src, depend = [], CPPPATH = CPPPATH) Return('group') 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; diff --git a/components/libc/posix/ipc/Kconfig b/components/libc/posix/ipc/Kconfig new file mode 100644 index 0000000000..f5ec6ad040 --- /dev/null +++ b/components/libc/posix/ipc/Kconfig @@ -0,0 +1,17 @@ +menu "Interprocess Communication (IPC)" + +config RT_USING_POSIX_PIPE + bool "Enable pipe and FIFO" + select RT_USING_POSIX_FS + select RT_USING_POSIX_DEVIO + select RT_USING_POSIX_POLL + default n + +config RT_USING_POSIX_PIPE_SIZE + int "Set pipe buffer size" + depends on RT_USING_POSIX_PIPE + default 512 + +comment "Socket is in the 'Network' category" + +endmenu diff --git a/components/libc/posix/ipc/sys/ipc.h b/components/libc/posix/ipc/sys/ipc.h new file mode 100644 index 0000000000..03b5458d51 --- /dev/null +++ b/components/libc/posix/ipc/sys/ipc.h @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2006-2021, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2021-12-07 Meco Man First version + */ +#ifndef __SYS_IPC_H__ +#define __SYS_IPC_H__ + + + +#endif diff --git a/components/libc/posix/ipc/sys/msg.h b/components/libc/posix/ipc/sys/msg.h new file mode 100644 index 0000000000..c030c9e8cb --- /dev/null +++ b/components/libc/posix/ipc/sys/msg.h @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2006-2021, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2021-12-07 Meco Man First version + */ +#ifndef __SYS_MSG_H__ +#define __SYS_MSG_H__ + + + +#endif diff --git a/components/libc/posix/ipc/sys/sem.h b/components/libc/posix/ipc/sys/sem.h new file mode 100644 index 0000000000..b849bd687d --- /dev/null +++ b/components/libc/posix/ipc/sys/sem.h @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2006-2021, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2021-12-07 Meco Man First version + */ +#ifndef __SYS_SEM_H__ +#define __SYS_SEM_H__ + + + +#endif diff --git a/components/libc/posix/ipc/sys/shm.h b/components/libc/posix/ipc/sys/shm.h new file mode 100644 index 0000000000..762d68891a --- /dev/null +++ b/components/libc/posix/ipc/sys/shm.h @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2006-2021, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2021-12-07 Meco Man First version + */ +#ifndef __SYS_SHM_H__ +#define __SYS_SHM_H__ + + + +#endif |
