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 #include diff --git a/components/libc/posix/Kconfig b/components/libc/posix/Kconfig index 52b5fdc948..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 " default n - config RT_USING_POSIX_MMAP + config RT_USING_POSIX_MMAN bool "Enable Memory-Mapped I/O " default n endif 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 similarity index 98% rename from components/libc/posix/io/mmap.c rename to 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 #include -#include +#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 similarity index 96% rename from components/libc/compilers/common/sys/mman.h rename to 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/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 #include #include -#include +#include "poll.h" struct rt_poll_node;