Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
AdRainty
rt-thread
提交
2c525ecd
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,发现更多精彩内容 >>
提交
2c525ecd
编写于
9月 11, 2021
作者:
mysterywolf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
将dfs_posix.h的函数声明转移到unix标准头文件中
上级
ee55c58c
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
46 addition
and
104 deletion
+46
-104
components/dfs/include/dfs.h
components/dfs/include/dfs.h
+1
-7
components/dfs/include/dfs_posix.h
components/dfs/include/dfs_posix.h
+3
-38
components/libc/compilers/common/none-gcc/sys/types.h
components/libc/compilers/common/none-gcc/sys/types.h
+1
-0
components/libc/compilers/common/none-gcc/sys/unistd.h
components/libc/compilers/common/none-gcc/sys/unistd.h
+17
-53
components/libc/compilers/common/sys/statfs.h
components/libc/compilers/common/sys/statfs.h
+9
-6
components/libc/compilers/common/sys/vfs.h
components/libc/compilers/common/sys/vfs.h
+15
-0
未找到文件。
components/dfs/include/dfs.h
浏览文件 @
2c525ecd
...
...
@@ -18,6 +18,7 @@
#include <dirent.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/statfs.h>
#include <sys/time.h>
#include <rtdevice.h>
...
...
@@ -68,13 +69,6 @@ extern "C" {
#define DFS_F_EOF 0x04000000
#define DFS_F_ERR 0x08000000
struct
statfs
{
size_t
f_bsize
;
/* block size */
size_t
f_blocks
;
/* total data blocks in file system */
size_t
f_bfree
;
/* free blocks in file system */
};
struct
dfs_fdtable
{
uint32_t
maxfd
;
...
...
components/dfs/include/dfs_posix.h
浏览文件 @
2c525ecd
...
...
@@ -16,44 +16,9 @@
#define __DFS_POSIX_H__
#include <dfs_file.h>
#include <unistd.h>
#include <stdio.h>
/* rename() */
#include <sys/stat.h>
#ifdef __cplusplus
extern
"C"
{
#endif
/* file api*/
int
close
(
int
d
);
#if defined(RT_USING_NEWLIB) && defined(_EXFUN)
_READ_WRITE_RETURN_TYPE
_EXFUN
(
read
,
(
int
__fd
,
void
*
__buf
,
size_t
__nbyte
));
_READ_WRITE_RETURN_TYPE
_EXFUN
(
write
,
(
int
__fd
,
const
void
*
__buf
,
size_t
__nbyte
));
#else
int
read
(
int
fd
,
void
*
buf
,
size_t
len
);
int
write
(
int
fd
,
const
void
*
buf
,
size_t
len
);
#endif
off_t
lseek
(
int
fd
,
off_t
offset
,
int
whence
);
int
rename
(
const
char
*
from
,
const
char
*
to
);
int
unlink
(
const
char
*
pathname
);
int
fsync
(
int
fildes
);
int
ftruncate
(
int
fd
,
off_t
length
);
/* directory api*/
int
rmdir
(
const
char
*
path
);
int
chdir
(
const
char
*
path
);
char
*
getcwd
(
char
*
buf
,
size_t
size
);
/* file system api */
int
statfs
(
const
char
*
path
,
struct
statfs
*
buf
);
int
access
(
const
char
*
path
,
int
amode
);
int
pipe
(
int
fildes
[
2
]);
#ifdef __cplusplus
}
#endif
#include <sys/statfs.h>
/* statfs() */
#endif
components/libc/compilers/common/none-gcc/sys/types.h
浏览文件 @
2c525ecd
...
...
@@ -12,6 +12,7 @@
#define __SYS_TYPES_H__
#include <stdint.h>
#include <stddef.h>
typedef
int32_t
clockid_t
;
typedef
int32_t
key_t
;
/* Used for interprocess communication. */
...
...
components/libc/compilers/common/none-gcc/sys/unistd.h
浏览文件 @
2c525ecd
...
...
@@ -6,68 +6,32 @@
* Change Logs:
* Date Author Notes
* 2020-12-16 Meco Man add usleep
* 2021-09-11 Meco Man move functions from dfs_posix.h to unistd.h
*/
#ifndef __SYS_UNISTD_H__
#define __SYS_UNISTD_H__
#include <rtconfig.h>
#include "types.h"
#ifdef RT_USING_DFS
#include <stddef.h>
#include "types.h"
/* <sys/types.h> */
#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 */
#ifndef O_RDONLY
#define O_RDONLY 0
/* +1 == FREAD */
#endif
#ifndef O_WRONLY
#define O_WRONLY 1
/* +1 == FWRITE */
#endif
#ifndef O_RDWR
#define O_RDWR 2
/* +1 == FREAD|FWRITE */
#endif
#ifndef O_APPEND
#define O_APPEND _FAPPEND
#endif
#ifndef O_CREAT
#define O_CREAT _FCREAT
#endif
#ifndef O_TRUNC
#define O_TRUNC _FTRUNC
#endif
#ifndef O_EXCL
#define O_EXCL _FEXCL
#endif
#ifndef O_SYNC
#define O_SYNC _FSYNC
#endif
#endif
int
isatty
(
int
fd
);
char
*
ttyname
(
int
desc
);
int
read
(
int
fd
,
void
*
buf
,
size_t
len
);
int
write
(
int
fd
,
const
void
*
buf
,
size_t
len
);
off_t
lseek
(
int
fd
,
off_t
offset
,
int
whence
);
int
fsync
(
int
fildes
);
int
unlink
(
const
char
*
pathname
);
int
close
(
int
d
);
int
ftruncate
(
int
fd
,
off_t
length
);
int
rmdir
(
const
char
*
path
);
int
chdir
(
const
char
*
path
);
char
*
getcwd
(
char
*
buf
,
size_t
size
);
int
access
(
const
char
*
path
,
int
amode
);
int
pipe
(
int
fildes
[
2
]);
int
isatty
(
int
fd
);
char
*
ttyname
(
int
desc
);
unsigned
int
sleep
(
unsigned
int
seconds
);
int
usleep
(
useconds_t
usec
);
pid_t
gettid
(
void
);
...
...
components/libc/compilers/common/sys/statfs.h
浏览文件 @
2c525ecd
...
...
@@ -6,16 +6,19 @@
* Change Logs:
* Date Author Notes
*/
#ifndef __
RTT
_STATFS_H__
#define __
RTT
_STATFS_H__
#ifndef __
SYS
_STATFS_H__
#define __
SYS
_STATFS_H__
#include <
rtthread
.h>
#include <
stddef
.h>
struct
statfs
{
rt_
size_t
f_bsize
;
/* block size */
rt_
size_t
f_blocks
;
/* total data blocks in file system */
rt_
size_t
f_bfree
;
/* free blocks in file system */
size_t
f_bsize
;
/* block size */
size_t
f_blocks
;
/* total data blocks in file system */
size_t
f_bfree
;
/* free blocks in file system */
};
int
statfs
(
const
char
*
path
,
struct
statfs
*
buf
);
int
fstatfs
(
int
fd
,
struct
statfs
*
buf
);
#endif
components/libc/compilers/common/sys/vfs.h
0 → 100644
浏览文件 @
2c525ecd
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2021-09-11 Meco Man First version
*/
#ifndef __SYS_VFS_H__
#define __SYS_VFS_H__
#include "statfs.h"
/* <sys/statfs.h> */
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录