Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
AdRainty
rt-thread
提交
9d401ea8
R
rt-thread
项目概览
AdRainty
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9d401ea8
编写于
4月 18, 2021
作者:
mysterywolf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
重新整理libc重复共用文件,创建common_for_all 和 common_for_keiliar
上级
349a85e8
变更
28
隐藏空白更改
内联
并排
Showing
28 changed file
with
21 addition
and
366 deletion
+21
-366
components/libc/compilers/armlibc/dirent.h
components/libc/compilers/armlibc/dirent.h
+0
-62
components/libc/compilers/armlibc/sys/mman.h
components/libc/compilers/armlibc/sys/mman.h
+0
-58
components/libc/compilers/common_all/SConscript
components/libc/compilers/common_all/SConscript
+0
-0
components/libc/compilers/common_all/dirent.h
components/libc/compilers/common_all/dirent.h
+0
-0
components/libc/compilers/common_all/readme.md
components/libc/compilers/common_all/readme.md
+0
-0
components/libc/compilers/common_all/stdlib.c
components/libc/compilers/common_all/stdlib.c
+0
-0
components/libc/compilers/common_all/sys/ioctl.h
components/libc/compilers/common_all/sys/ioctl.h
+4
-1
components/libc/compilers/common_all/sys/mman.h
components/libc/compilers/common_all/sys/mman.h
+2
-0
components/libc/compilers/common_all/sys/statfs.h
components/libc/compilers/common_all/sys/statfs.h
+0
-0
components/libc/compilers/common_all/sys/termios.h
components/libc/compilers/common_all/sys/termios.h
+0
-0
components/libc/compilers/common_all/sys/time.h
components/libc/compilers/common_all/sys/time.h
+0
-0
components/libc/compilers/common_all/termios.h
components/libc/compilers/common_all/termios.h
+0
-0
components/libc/compilers/common_all/time.c
components/libc/compilers/common_all/time.c
+0
-0
components/libc/compilers/common_all/unistd.c
components/libc/compilers/common_all/unistd.c
+0
-0
components/libc/compilers/common_except_gcc/SConscript
components/libc/compilers/common_except_gcc/SConscript
+13
-0
components/libc/compilers/common_except_gcc/fcntl.h
components/libc/compilers/common_except_gcc/fcntl.h
+0
-0
components/libc/compilers/common_except_gcc/sys/stat.h
components/libc/compilers/common_except_gcc/sys/stat.h
+0
-0
components/libc/compilers/common_except_gcc/sys/types.h
components/libc/compilers/common_except_gcc/sys/types.h
+2
-0
components/libc/compilers/common_except_gcc/sys/unistd.h
components/libc/compilers/common_except_gcc/sys/unistd.h
+0
-0
components/libc/compilers/common_except_gcc/unistd.h
components/libc/compilers/common_except_gcc/unistd.h
+0
-0
components/libc/compilers/dlib/dirent.h
components/libc/compilers/dlib/dirent.h
+0
-62
components/libc/compilers/dlib/fcntl.h
components/libc/compilers/dlib/fcntl.h
+0
-8
components/libc/compilers/dlib/sys/mman.h
components/libc/compilers/dlib/sys/mman.h
+0
-58
components/libc/compilers/dlib/sys/stat.h
components/libc/compilers/dlib/sys/stat.h
+0
-8
components/libc/compilers/dlib/sys/types.h
components/libc/compilers/dlib/sys/types.h
+0
-33
components/libc/compilers/dlib/sys/unistd.h
components/libc/compilers/dlib/sys/unistd.h
+0
-57
components/libc/compilers/dlib/unistd.h
components/libc/compilers/dlib/unistd.h
+0
-14
include/rtlibc.h
include/rtlibc.h
+0
-5
未找到文件。
components/libc/compilers/armlibc/dirent.h
已删除
100644 → 0
浏览文件 @
349a85e8
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
*/
#ifndef __RTT_DIRENT_H__
#define __RTT_DIRENT_H__
#include <rtthread.h>
#include <rtlibc.h>
/*
* dirent.h - format of directory entries
* Ref: http://www.opengroup.org/onlinepubs/009695399/basedefs/dirent.h.html
*/
/* File types */
#define FT_REGULAR 0
/* regular file */
#define FT_SOCKET 1
/* socket file */
#define FT_DIRECTORY 2
/* directory */
#define FT_USER 3
/* user defined */
#ifdef __cplusplus
extern
"C"
{
#endif
#ifndef HAVE_DIR_STRUCTURE
typedef
struct
{
int
fd
;
/* directory file */
char
buf
[
512
];
int
num
;
int
cur
;
}
DIR
;
#endif
#ifndef HAVE_DIRENT_STRUCTURE
struct
dirent
{
rt_uint8_t
d_type
;
/* The type of the file */
rt_uint8_t
d_namlen
;
/* The length of the not including the terminating null file name */
rt_uint16_t
d_reclen
;
/* length of this record */
char
d_name
[
256
];
/* The null-terminated file name */
};
#endif
int
closedir
(
DIR
*
);
DIR
*
opendir
(
const
char
*
);
struct
dirent
*
readdir
(
DIR
*
);
int
readdir_r
(
DIR
*
,
struct
dirent
*
,
struct
dirent
**
);
void
rewinddir
(
DIR
*
);
void
seekdir
(
DIR
*
,
long
int
);
long
telldir
(
DIR
*
);
#ifdef __cplusplus
}
#endif
#endif
components/libc/compilers/armlibc/sys/mman.h
已删除
100644 → 0
浏览文件 @
349a85e8
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2017/11/30 Bernard The first version.
*/
#ifndef _SYS_MMAN_H
#define _SYS_MMAN_H
#ifdef __cplusplus
extern
"C"
{
#endif
#define MAP_FAILED ((void *) -1)
#define MAP_SHARED 0x01
#define MAP_PRIVATE 0x02
#define MAP_TYPE 0x0f
#define MAP_FIXED 0x10
#define MAP_ANON 0x20
#define MAP_ANONYMOUS MAP_ANON
#define MAP_NORESERVE 0x4000
#define MAP_GROWSDOWN 0x0100
#define MAP_DENYWRITE 0x0800
#define MAP_EXECUTABLE 0x1000
#define MAP_LOCKED 0x2000
#define MAP_POPULATE 0x8000
#define MAP_NONBLOCK 0x10000
#define MAP_STACK 0x20000
#define MAP_HUGETLB 0x40000
#define MAP_FILE 0
#define PROT_NONE 0
#define PROT_READ 1
#define PROT_WRITE 2
#define PROT_EXEC 4
#define PROT_GROWSDOWN 0x01000000
#define PROT_GROWSUP 0x02000000
#define MS_ASYNC 1
#define MS_INVALIDATE 2
#define MS_SYNC 4
#define MCL_CURRENT 1
#define MCL_FUTURE 2
#define MCL_ONFAULT 4
void
*
mmap
(
void
*
start
,
size_t
len
,
int
prot
,
int
flags
,
int
fd
,
off_t
off
);
int
munmap
(
void
*
start
,
size_t
len
);
#ifdef __cplusplus
}
#endif
#endif
components/libc/compilers/common/SConscript
→
components/libc/compilers/common
_all
/SConscript
浏览文件 @
9d401ea8
文件已移动
components/libc/compilers/
newlib/sys
/dirent.h
→
components/libc/compilers/
common_all
/dirent.h
浏览文件 @
9d401ea8
文件已移动
components/libc/compilers/common/readme.md
→
components/libc/compilers/common
_all
/readme.md
浏览文件 @
9d401ea8
文件已移动
components/libc/compilers/common/stdlib.c
→
components/libc/compilers/common
_all
/stdlib.c
浏览文件 @
9d401ea8
文件已移动
components/libc/compilers/common/sys/ioctl.h
→
components/libc/compilers/common
_all
/sys/ioctl.h
浏览文件 @
9d401ea8
...
@@ -10,6 +10,9 @@
...
@@ -10,6 +10,9 @@
#ifndef _SYS_IOCTL_H
#ifndef _SYS_IOCTL_H
#define _SYS_IOCTL_H
#define _SYS_IOCTL_H
#include <rtconfig.h>
#ifdef RT_USING_POSIX
#include <dfs_posix.h>
#endif
#endif
#endif
components/libc/compilers/
newlib
/sys/mman.h
→
components/libc/compilers/
common_all
/sys/mman.h
浏览文件 @
9d401ea8
...
@@ -15,6 +15,8 @@
...
@@ -15,6 +15,8 @@
extern
"C"
{
extern
"C"
{
#endif
#endif
#include <sys/types.h>
#define MAP_FAILED ((void *) -1)
#define MAP_FAILED ((void *) -1)
#define MAP_SHARED 0x01
#define MAP_SHARED 0x01
...
...
components/libc/compilers/
newlib
/sys/statfs.h
→
components/libc/compilers/
common_all
/sys/statfs.h
浏览文件 @
9d401ea8
文件已移动
components/libc/compilers/
newlib
/sys/termios.h
→
components/libc/compilers/
common_all
/sys/termios.h
浏览文件 @
9d401ea8
文件已移动
components/libc/compilers/common/sys/time.h
→
components/libc/compilers/common
_all
/sys/time.h
浏览文件 @
9d401ea8
文件已移动
components/libc/compilers/common/termios.h
→
components/libc/compilers/common
_all
/termios.h
浏览文件 @
9d401ea8
文件已移动
components/libc/compilers/common/time.c
→
components/libc/compilers/common
_all
/time.c
浏览文件 @
9d401ea8
文件已移动
components/libc/compilers/common/unistd.c
→
components/libc/compilers/common
_all
/unistd.c
浏览文件 @
9d401ea8
文件已移动
components/libc/compilers/common_except_gcc/SConscript
0 → 100644
浏览文件 @
9d401ea8
from
building
import
*
Import
(
'rtconfig'
)
if
rtconfig
.
PLATFORM
==
'iar'
or
rtconfig
.
PLATFORM
==
'armcc'
or
rtconfig
.
PLATFORM
==
'armclang'
:
src
=
[]
cwd
=
GetCurrentDir
()
CPPPATH
=
[
cwd
]
group
=
[]
src
+=
Glob
(
'*.c'
)
group
=
DefineGroup
(
'libc'
,
src
,
depend
=
[
'RT_USING_LIBC'
],
CPPPATH
=
CPPPATH
)
Return
(
'group'
)
components/libc/compilers/
armlib
c/fcntl.h
→
components/libc/compilers/
common_except_gc
c/fcntl.h
浏览文件 @
9d401ea8
文件已移动
components/libc/compilers/
armlib
c/sys/stat.h
→
components/libc/compilers/
common_except_gc
c/sys/stat.h
浏览文件 @
9d401ea8
文件已移动
components/libc/compilers/
armlib
c/sys/types.h
→
components/libc/compilers/
common_except_gc
c/sys/types.h
浏览文件 @
9d401ea8
...
@@ -18,6 +18,8 @@ typedef int32_t key_t; /* Used for interprocess communication.
...
@@ -18,6 +18,8 @@ typedef int32_t key_t; /* Used for interprocess communication.
typedef
int
pid_t
;
/* Used for process IDs and process group IDs. */
typedef
int
pid_t
;
/* Used for process IDs and process group IDs. */
typedef
unsigned
short
uid_t
;
typedef
unsigned
short
uid_t
;
typedef
unsigned
short
gid_t
;
typedef
unsigned
short
gid_t
;
typedef
signed
long
off_t
;
typedef
int
mode_t
;
#ifndef ARCH_CPU_64BIT
#ifndef ARCH_CPU_64BIT
typedef
signed
int
ssize_t
;
/* Used for a count of bytes or an error indication. */
typedef
signed
int
ssize_t
;
/* Used for a count of bytes or an error indication. */
#else
#else
...
...
components/libc/compilers/
armlib
c/sys/unistd.h
→
components/libc/compilers/
common_except_gc
c/sys/unistd.h
浏览文件 @
9d401ea8
文件已移动
components/libc/compilers/
armlib
c/unistd.h
→
components/libc/compilers/
common_except_gc
c/unistd.h
浏览文件 @
9d401ea8
文件已移动
components/libc/compilers/dlib/dirent.h
已删除
100644 → 0
浏览文件 @
349a85e8
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
*/
#ifndef __RTT_DIRENT_H__
#define __RTT_DIRENT_H__
#include <rtthread.h>
#include <rtlibc.h>
/*
* dirent.h - format of directory entries
* Ref: http://www.opengroup.org/onlinepubs/009695399/basedefs/dirent.h.html
*/
/* File types */
#define FT_REGULAR 0
/* regular file */
#define FT_SOCKET 1
/* socket file */
#define FT_DIRECTORY 2
/* directory */
#define FT_USER 3
/* user defined */
#ifdef __cplusplus
extern
"C"
{
#endif
#ifndef HAVE_DIR_STRUCTURE
typedef
struct
{
int
fd
;
/* directory file */
char
buf
[
512
];
int
num
;
int
cur
;
}
DIR
;
#endif
#ifndef HAVE_DIRENT_STRUCTURE
struct
dirent
{
rt_uint8_t
d_type
;
/* The type of the file */
rt_uint8_t
d_namlen
;
/* The length of the not including the terminating null file name */
rt_uint16_t
d_reclen
;
/* length of this record */
char
d_name
[
256
];
/* The null-terminated file name */
};
#endif
int
closedir
(
DIR
*
);
DIR
*
opendir
(
const
char
*
);
struct
dirent
*
readdir
(
DIR
*
);
int
readdir_r
(
DIR
*
,
struct
dirent
*
,
struct
dirent
**
);
void
rewinddir
(
DIR
*
);
void
seekdir
(
DIR
*
,
long
int
);
long
telldir
(
DIR
*
);
#ifdef __cplusplus
}
#endif
#endif
components/libc/compilers/dlib/fcntl.h
已删除
100644 → 0
浏览文件 @
349a85e8
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
*/
components/libc/compilers/dlib/sys/mman.h
已删除
100644 → 0
浏览文件 @
349a85e8
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2017/11/30 Bernard The first version.
*/
#ifndef _SYS_MMAN_H
#define _SYS_MMAN_H
#ifdef __cplusplus
extern
"C"
{
#endif
#define MAP_FAILED ((void *) -1)
#define MAP_SHARED 0x01
#define MAP_PRIVATE 0x02
#define MAP_TYPE 0x0f
#define MAP_FIXED 0x10
#define MAP_ANON 0x20
#define MAP_ANONYMOUS MAP_ANON
#define MAP_NORESERVE 0x4000
#define MAP_GROWSDOWN 0x0100
#define MAP_DENYWRITE 0x0800
#define MAP_EXECUTABLE 0x1000
#define MAP_LOCKED 0x2000
#define MAP_POPULATE 0x8000
#define MAP_NONBLOCK 0x10000
#define MAP_STACK 0x20000
#define MAP_HUGETLB 0x40000
#define MAP_FILE 0
#define PROT_NONE 0
#define PROT_READ 1
#define PROT_WRITE 2
#define PROT_EXEC 4
#define PROT_GROWSDOWN 0x01000000
#define PROT_GROWSUP 0x02000000
#define MS_ASYNC 1
#define MS_INVALIDATE 2
#define MS_SYNC 4
#define MCL_CURRENT 1
#define MCL_FUTURE 2
#define MCL_ONFAULT 4
void
*
mmap
(
void
*
start
,
size_t
len
,
int
prot
,
int
flags
,
int
fd
,
off_t
off
);
int
munmap
(
void
*
start
,
size_t
len
);
#ifdef __cplusplus
}
#endif
#endif
components/libc/compilers/dlib/sys/stat.h
已删除
100644 → 0
浏览文件 @
349a85e8
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
*/
components/libc/compilers/dlib/sys/types.h
已删除
100644 → 0
浏览文件 @
349a85e8
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2020-12-16 Meco Man add useconds_t
*/
#ifndef __TYPES_H__
#define __TYPES_H__
#include <stdint.h>
typedef
int32_t
clockid_t
;
typedef
int32_t
key_t
;
/* Used for interprocess communication. */
typedef
int
pid_t
;
/* Used for process IDs and process group IDs. */
typedef
unsigned
short
uid_t
;
typedef
unsigned
short
gid_t
;
#ifndef ARCH_CPU_64BIT
typedef
signed
int
ssize_t
;
/* Used for a count of bytes or an error indication. */
#else
typedef
long
signed
int
ssize_t
;
/* Used for a count of bytes or an error indication. */
#endif
typedef
unsigned
long
useconds_t
;
/* microseconds (unsigned) */
typedef
unsigned
long
dev_t
;
typedef
unsigned
int
u_int
;
typedef
unsigned
char
u_char
;
typedef
unsigned
long
u_long
;
#endif
components/libc/compilers/dlib/sys/unistd.h
已删除
100644 → 0
浏览文件 @
349a85e8
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2020-12-16 Meco Man add usleep
*/
#ifndef _SYS_UNISTD_H
#define _SYS_UNISTD_H
#include <rtconfig.h>
#include "types.h"
#ifdef RT_USING_DFS
#define STDIN_FILENO 0
/* standard input file descriptor */
#define STDOUT_FILENO 1
/* standard output file descriptor */
#define STDERR_FILENO 2
/* standard error file descriptor */
#include <dfs_posix.h>
#else
#define _FREAD 0x0001
/* read enabled */
#define _FWRITE 0x0002
/* write enabled */
#define _FAPPEND 0x0008
/* append (writes guaranteed at the end) */
#define _FMARK 0x0010
/* internal; mark during gc() */
#define _FDEFER 0x0020
/* internal; defer for next gc pass */
#define _FASYNC 0x0040
/* signal pgrp when data ready */
#define _FSHLOCK 0x0080
/* BSD flock() shared lock present */
#define _FEXLOCK 0x0100
/* BSD flock() exclusive lock present */
#define _FCREAT 0x0200
/* open with file create */
#define _FTRUNC 0x0400
/* open with truncation */
#define _FEXCL 0x0800
/* error on open if file exists */
#define _FNBIO 0x1000
/* non blocking I/O (sys5 style) */
#define _FSYNC 0x2000
/* do all writes synchronously */
#define _FNONBLOCK 0x4000
/* non blocking I/O (POSIX style) */
#define _FNDELAY _FNONBLOCK
/* non blocking I/O (4.2 style) */
#define _FNOCTTY 0x8000
/* don't assign a ctty on this open */
#endif
int
isatty
(
int
fd
);
char
*
ttyname
(
int
desc
);
unsigned
int
sleep
(
unsigned
int
seconds
);
int
usleep
(
useconds_t
usec
);
pid_t
getpid
(
void
);
pid_t
getppid
(
void
);
uid_t
getuid
(
void
);
uid_t
geteuid
(
void
);
gid_t
getgid
(
void
);
gid_t
getegid
(
void
);
#endif
/* _SYS_UNISTD_H */
components/libc/compilers/dlib/unistd.h
已删除
100644 → 0
浏览文件 @
349a85e8
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
*/
#ifndef _UNISTD_H_
#define _UNISTD_H_
# include "sys/unistd.h"
#endif
/* _UNISTD_H_ */
include/rtlibc.h
浏览文件 @
9d401ea8
...
@@ -23,11 +23,6 @@
...
@@ -23,11 +23,6 @@
#include "libc/libc_limits.h"
#include "libc/libc_limits.h"
#include "libc/libc_stdio.h"
#include "libc/libc_stdio.h"
#if defined(__CC_ARM) || defined(__CLANG_ARM) || defined(__IAR_SYSTEMS_ICC__)
typedef
signed
long
off_t
;
typedef
int
mode_t
;
#endif
#if defined(__MINGW32__) || defined(_WIN32)
#if defined(__MINGW32__) || defined(_WIN32)
typedef
signed
long
off_t
;
typedef
signed
long
off_t
;
typedef
int
mode_t
;
typedef
int
mode_t
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录