Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Musl
提交
82e427c0
T
Third Party Musl
项目概览
OpenHarmony
/
Third Party Musl
接近 2 年 前同步成功
通知
37
Star
125
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Musl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
82e427c0
编写于
5月 30, 2023
作者:
O
openharmony_ci
提交者:
Gitee
5月 30, 2023
浏览文件
操作
浏览文件
下载
差异文件
!927 fix no output from pipeline when run hdc shell bm get -t
Merge pull request !927 from Wang Yaofeng/write
上级
73c0c696
53dee026
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
0 addition
and
66 deletion
+0
-66
musl_src.gni
musl_src.gni
+0
-1
porting/linux/user/src/internal/stdio_impl.h
porting/linux/user/src/internal/stdio_impl.h
+0
-1
porting/linux/user/src/stdio/__stdio_write.c
porting/linux/user/src/stdio/__stdio_write.c
+0
-64
未找到文件。
musl_src.gni
浏览文件 @
82e427c0
...
...
@@ -2167,7 +2167,6 @@ musl_src_porting_file = [
"src/stdio/__fdopen.c",
"src/stdio/vfprintf.c",
"src/stdio/__stdio_read.c",
"src/stdio/__stdio_write.c",
"src/stdio/fread.c",
"src/stdio/fmemopen.c",
"src/stdio/freopen.c",
...
...
porting/linux/user/src/internal/stdio_impl.h
浏览文件 @
82e427c0
...
...
@@ -63,7 +63,6 @@ hidden off_t __stdio_seek(FILE *, off_t, int);
hidden
int
__stdio_close
(
FILE
*
);
hidden
int
__fill_buffer
(
FILE
*
f
);
hidden
ssize_t
__flush_buffer
(
FILE
*
f
);
hidden
int
__toread
(
FILE
*
);
hidden
int
__towrite
(
FILE
*
);
...
...
porting/linux/user/src/stdio/__stdio_write.c
已删除
100644 → 0
浏览文件 @
73c0c696
#include "stdio_impl.h"
#include <sys/uio.h>
#include <string.h>
ssize_t
__flush_buffer
(
FILE
*
f
)
{
ssize_t
cnt
=
0
;
char
*
wbase
=
(
char
*
)
f
->
wbase
;
size_t
rem
=
f
->
wpos
-
f
->
wbase
;
while
(
rem
>
0
)
{
cnt
=
syscall
(
SYS_write
,
f
->
fd
,
wbase
,
rem
);
if
(
cnt
<
0
)
{
f
->
wpos
=
f
->
wbase
=
f
->
wend
=
0
;
f
->
flags
|=
F_ERR
;
return
cnt
;
}
wbase
+=
cnt
;
rem
-=
cnt
;
}
/* reset file buffer */
f
->
wend
=
f
->
buf
+
f
->
buf_size
;
f
->
wpos
=
f
->
wbase
=
f
->
buf
;
return
cnt
;
}
size_t
__stdio_write
(
FILE
*
f
,
const
unsigned
char
*
buf
,
size_t
len
)
{
size_t
rem
=
len
;
unsigned
char
*
wbuf
=
(
unsigned
char
*
)
buf
;
/* flush buffer first */
ssize_t
cnt
=
__flush_buffer
(
f
);
if
(
cnt
<
0
)
{
return
0
;
}
for
(;;)
{
if
(
f
->
lbf
<
0
&&
rem
<=
f
->
wend
-
f
->
wpos
)
{
memcpy
(
f
->
wpos
,
wbuf
,
rem
);
f
->
wpos
+=
rem
;
return
len
;
}
/* write directly if
* 1. file buffer < rem
* 2. line buffer mode
*/
cnt
=
syscall
(
SYS_write
,
f
->
fd
,
wbuf
,
rem
);
if
(
cnt
<
0
)
{
f
->
wpos
=
f
->
wbase
=
f
->
wend
=
0
;
f
->
flags
|=
F_ERR
;
return
len
-
rem
;
}
rem
-=
cnt
;
wbuf
+=
cnt
;
if
(
rem
==
0
)
{
break
;
}
}
return
len
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录