diff options
| author | Wayne Lin <[email protected]> | 2022-01-10 12:36:11 +0800 |
|---|---|---|
| committer | Wayne Lin <[email protected]> | 2022-01-10 12:36:11 +0800 |
| commit | 715eecd3eb6cfbbc95aba4fdf932db2e1a7698fb (patch) | |
| tree | 111003eb53eaa4a789729792a622d2abfd602031 /components/libc/posix | |
| parent | 6d2a7d00db2808f26b96efaebfa3aa18b6fd47b8 (diff) | |
| parent | 5206f6504018d1e1978e1c547f6a5b782d505be5 (diff) | |
Merge branch 'master' of https://github.com/RT-Thread/rt-thread into nuvoton
# Conflicts:
# bsp/nuvoton/nk-980iot/.config
# bsp/nuvoton/nk-n9h30/.config
# bsp/nuvoton/nk-rtu980/.config
# bsp/nuvoton/numaker-iot-m487/.config
# bsp/nuvoton/numaker-m2354/.config
# bsp/nuvoton/numaker-pfm-m487/.config
Diffstat (limited to 'components/libc/posix')
| -rw-r--r-- | components/libc/posix/Kconfig | 7 | ||||
| -rw-r--r-- | components/libc/posix/delay/delay.c | 1 | ||||
| -rw-r--r-- | components/libc/posix/delay/delay.h | 1 | ||||
| -rw-r--r-- | components/libc/posix/io/SConscript | 2 | ||||
| -rw-r--r-- | components/libc/posix/io/libc.c | 9 | ||||
| -rw-r--r-- | components/libc/posix/io/libc.h | 5 | ||||
| -rw-r--r-- | components/libc/posix/io/poll/poll.c | 1 | ||||
| -rw-r--r-- | components/libc/posix/io/poll/poll.h | 1 | ||||
| -rw-r--r-- | components/libc/posix/io/select.c | 1 | ||||
| -rw-r--r-- | components/libc/posix/io/termios/termios.c | 1 | ||||
| -rw-r--r-- | components/libc/posix/io/termios/termios.h | 1 | ||||
| -rw-r--r-- | components/libc/posix/ipc/system-v/sys/ipc.h | 1 | ||||
| -rw-r--r-- | components/libc/posix/ipc/system-v/sys/msg.h | 1 | ||||
| -rw-r--r-- | components/libc/posix/ipc/system-v/sys/sem.h | 1 | ||||
| -rw-r--r-- | components/libc/posix/ipc/system-v/sys/shm.h | 1 |
15 files changed, 26 insertions, 8 deletions
diff --git a/components/libc/posix/Kconfig b/components/libc/posix/Kconfig index f7f2855ec9..76dabc2734 100644 --- a/components/libc/posix/Kconfig +++ b/components/libc/posix/Kconfig @@ -12,6 +12,11 @@ if RT_USING_POSIX_FS select RT_USING_DFS_DEVFS default n + config RT_USING_POSIX_STDIO + bool "Enable standard I/O devices, e.g. STDOUT_FILENO" + select RT_USING_POSIX_DEVIO + default n + config RT_USING_POSIX_POLL bool "Enable I/O Multiplexing poll() <poll.h>" default n @@ -23,7 +28,7 @@ if RT_USING_POSIX_FS config RT_USING_POSIX_TERMIOS bool "Enable Terminal I/O <termios.h>" - select RT_USING_POSIX_DEVIO + select RT_USING_POSIX_STDIO default n config RT_USING_POSIX_AIO diff --git a/components/libc/posix/delay/delay.c b/components/libc/posix/delay/delay.c index c8564dc54e..753ca48526 100644 --- a/components/libc/posix/delay/delay.c +++ b/components/libc/posix/delay/delay.c @@ -7,6 +7,7 @@ * Date Author Notes * 2021-05-07 Meco Man first Version */ + #include <sys/types.h> #include <rtthread.h> #include <rthw.h> diff --git a/components/libc/posix/delay/delay.h b/components/libc/posix/delay/delay.h index f32708af55..19492bdb45 100644 --- a/components/libc/posix/delay/delay.h +++ b/components/libc/posix/delay/delay.h @@ -7,6 +7,7 @@ * Date Author Notes * 2021-05-07 Meco Man first Version */ + #ifndef __DELAY_H__ #define __DELAY_H__ diff --git a/components/libc/posix/io/SConscript b/components/libc/posix/io/SConscript index 0771ec67be..bb45211ec0 100644 --- a/components/libc/posix/io/SConscript +++ b/components/libc/posix/io/SConscript @@ -10,7 +10,7 @@ group = [] flag = False -if GetDepend('RT_USING_POSIX_DEVIO'): +if GetDepend('RT_USING_POSIX_STDIO'): src += ['libc.c'] flag = True diff --git a/components/libc/posix/io/libc.c b/components/libc/posix/io/libc.c index 4bb647c16b..e57749f1da 100644 --- a/components/libc/posix/io/libc.c +++ b/components/libc/posix/io/libc.c @@ -7,6 +7,7 @@ * Date Author Notes * 2017/10/15 bernard the first version */ + #include <rtthread.h> #include <stdio.h> #include <stdlib.h> @@ -20,7 +21,7 @@ int libc_system_init(void) { -#ifdef RT_USING_POSIX_DEVIO +#ifdef RT_USING_POSIX_STDIO rt_device_t dev_console; dev_console = rt_console_get_device(); @@ -28,12 +29,12 @@ int libc_system_init(void) { libc_stdio_set_console(dev_console->parent.name, O_RDWR); } -#endif /* RT_USING_POSIX_DEVIO */ +#endif /* RT_USING_POSIX_STDIO */ return 0; } INIT_COMPONENT_EXPORT(libc_system_init); -#if defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_NEWLIB) +#if defined(RT_USING_POSIX_STDIO) && defined(RT_USING_NEWLIB) #define STDIO_DEVICE_NAME_MAX 32 static FILE* std_console = NULL; int libc_stdio_set_console(const char* device_name, int mode) @@ -134,4 +135,4 @@ int libc_stdio_set_console(const char* device_name, int mode) int libc_stdio_get_console(void) { return std_fd; } -#endif /* defined(RT_USING_POSIX_DEVIO) && defined(RT_USING_NEWLIB) */ +#endif /* defined(RT_USING_POSIX_STDIO) && defined(RT_USING_NEWLIB) */ diff --git a/components/libc/posix/io/libc.h b/components/libc/posix/io/libc.h index b019267926..6b5dfd1fcc 100644 --- a/components/libc/posix/io/libc.h +++ b/components/libc/posix/io/libc.h @@ -7,6 +7,7 @@ * Date Author Notes * 2017/10/15 bernard the first version */ + #ifndef __RTT_LIBC_H__ #define __RTT_LIBC_H__ @@ -17,10 +18,10 @@ extern "C" { #endif int libc_system_init(void); -#ifdef RT_USING_POSIX_DEVIO +#ifdef RT_USING_POSIX_STDIO int libc_stdio_get_console(void); int libc_stdio_set_console(const char* device_name, int mode); -#endif /* RT_USING_POSIX_DEVIO */ +#endif /* RT_USING_POSIX_STDIO */ #ifdef __cplusplus } diff --git a/components/libc/posix/io/poll/poll.c b/components/libc/posix/io/poll/poll.c index a1500ba109..3c5940b8d3 100644 --- a/components/libc/posix/io/poll/poll.c +++ b/components/libc/posix/io/poll/poll.c @@ -8,6 +8,7 @@ * 2016-12-28 Bernard first version * 2018-03-09 Bernard Add protection for pt->triggered. */ + #include <stdint.h> #include <rthw.h> #include <rtthread.h> diff --git a/components/libc/posix/io/poll/poll.h b/components/libc/posix/io/poll/poll.h index aea73d6eaf..0fccd48b0d 100644 --- a/components/libc/posix/io/poll/poll.h +++ b/components/libc/posix/io/poll/poll.h @@ -7,6 +7,7 @@ * Date Author Notes * 2021-09-11 Meco Man First version */ + #ifndef __POLL_H__ #define __POLL_H__ diff --git a/components/libc/posix/io/select.c b/components/libc/posix/io/select.c index 55d320e921..bac63258a5 100644 --- a/components/libc/posix/io/select.c +++ b/components/libc/posix/io/select.c @@ -7,6 +7,7 @@ * Date Author Notes * 2016-12-28 Bernard first version */ + #include <rtthread.h> #include <poll.h> #include <sys/select.h> diff --git a/components/libc/posix/io/termios/termios.c b/components/libc/posix/io/termios/termios.c index d7d869d67f..44e0e80853 100644 --- a/components/libc/posix/io/termios/termios.c +++ b/components/libc/posix/io/termios/termios.c @@ -7,6 +7,7 @@ * Date Author Notes * 2017/08/30 Bernard The first version */ + #include <stdlib.h> #include <string.h> #include <dfs_posix.h> diff --git a/components/libc/posix/io/termios/termios.h b/components/libc/posix/io/termios/termios.h index b647fa0728..27f2db85b0 100644 --- a/components/libc/posix/io/termios/termios.h +++ b/components/libc/posix/io/termios/termios.h @@ -7,6 +7,7 @@ * Date Author Notes * 2017/08/30 Bernard The first version */ + #ifndef __TERMIOS_H__ #define __TERMIOS_H__ diff --git a/components/libc/posix/ipc/system-v/sys/ipc.h b/components/libc/posix/ipc/system-v/sys/ipc.h index 03b5458d51..f4ac50a1e9 100644 --- a/components/libc/posix/ipc/system-v/sys/ipc.h +++ b/components/libc/posix/ipc/system-v/sys/ipc.h @@ -7,6 +7,7 @@ * Date Author Notes * 2021-12-07 Meco Man First version */ + #ifndef __SYS_IPC_H__ #define __SYS_IPC_H__ diff --git a/components/libc/posix/ipc/system-v/sys/msg.h b/components/libc/posix/ipc/system-v/sys/msg.h index c030c9e8cb..1489586a32 100644 --- a/components/libc/posix/ipc/system-v/sys/msg.h +++ b/components/libc/posix/ipc/system-v/sys/msg.h @@ -7,6 +7,7 @@ * Date Author Notes * 2021-12-07 Meco Man First version */ + #ifndef __SYS_MSG_H__ #define __SYS_MSG_H__ diff --git a/components/libc/posix/ipc/system-v/sys/sem.h b/components/libc/posix/ipc/system-v/sys/sem.h index fdb70496d8..4a32c91204 100644 --- a/components/libc/posix/ipc/system-v/sys/sem.h +++ b/components/libc/posix/ipc/system-v/sys/sem.h @@ -7,6 +7,7 @@ * Date Author Notes * 2021-12-07 Meco Man First version */ + #ifndef __SYS_SEM_H__ #define __SYS_SEM_H__ diff --git a/components/libc/posix/ipc/system-v/sys/shm.h b/components/libc/posix/ipc/system-v/sys/shm.h index 762d68891a..5b536067fc 100644 --- a/components/libc/posix/ipc/system-v/sys/shm.h +++ b/components/libc/posix/ipc/system-v/sys/shm.h @@ -7,6 +7,7 @@ * Date Author Notes * 2021-12-07 Meco Man First version */ + #ifndef __SYS_SHM_H__ #define __SYS_SHM_H__ |
