[posix][mmap] create the mman folder

This commit is contained in:
Meco Man 2021-12-07 15:47:00 -05:00 committed by Bernard Xiong
parent ce8085befa
commit 15435b6850
7 changed files with 18 additions and 11 deletions

View File

@ -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>

View File

@ -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

View File

@ -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)

View File

@ -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')

View File

@ -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)

View File

@ -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" {

View File

@ -12,7 +12,7 @@
#include <rthw.h>
#include <rtthread.h>
#include <dfs_file.h>
#include <poll.h>
#include "poll.h"
struct rt_poll_node;