Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
56c8f68f
Q
qemu
项目概览
openeuler
/
qemu
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
56c8f68f
编写于
11月 28, 2005
作者:
B
bellard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
statfs fix
git-svn-id:
svn://svn.savannah.nongnu.org/qemu/trunk@1680
c046a42c-6fe2-441c-8c8c-71466251a162
上级
c960bde1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
99 addition
and
19 deletion
+99
-19
linux-user/syscall.c
linux-user/syscall.c
+37
-19
linux-user/syscall_defs.h
linux-user/syscall_defs.h
+62
-0
未找到文件。
linux-user/syscall.c
浏览文件 @
56c8f68f
...
...
@@ -42,6 +42,7 @@
#include <sys/poll.h>
#include <sys/times.h>
#include <sys/shm.h>
#include <sys/statfs.h>
#include <utime.h>
#include <sys/sysinfo.h>
//#include <sys/user.h>
...
...
@@ -202,8 +203,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
#define __NR_sys_uname __NR_uname
#define __NR_sys_getcwd1 __NR_getcwd
#define __NR_sys_statfs __NR_statfs
#define __NR_sys_fstatfs __NR_fstatfs
#define __NR_sys_getdents __NR_getdents
#define __NR_sys_getdents64 __NR_getdents64
#define __NR_sys_rt_sigqueueinfo __NR_rt_sigqueueinfo
...
...
@@ -225,8 +224,6 @@ _syscall3(int, sys_getdents, uint, fd, struct dirent *, dirp, uint, count);
_syscall3
(
int
,
sys_getdents64
,
uint
,
fd
,
struct
dirent64
*
,
dirp
,
uint
,
count
);
_syscall5
(
int
,
_llseek
,
uint
,
fd
,
ulong
,
hi
,
ulong
,
lo
,
loff_t
*
,
res
,
uint
,
wh
);
_syscall2
(
int
,
sys_statfs
,
const
char
*
,
path
,
struct
kernel_statfs
*
,
buf
)
_syscall2
(
int
,
sys_fstatfs
,
int
,
fd
,
struct
kernel_statfs
*
,
buf
)
_syscall3
(
int
,
sys_rt_sigqueueinfo
,
int
,
pid
,
int
,
sig
,
siginfo_t
*
,
uinfo
)
#ifdef __NR_exit_group
_syscall1
(
int
,
exit_group
,
int
,
error_code
)
...
...
@@ -1659,7 +1656,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
{
long
ret
;
struct
stat
st
;
struct
kernel_statfs
*
stfs
;
struct
statfs
stfs
;
#ifdef DEBUG
gemu_log
(
"syscall %d"
,
num
);
...
...
@@ -2298,26 +2295,47 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
goto
unimplemented
;
#endif
case
TARGET_NR_statfs
:
stfs
=
(
void
*
)
arg2
;
ret
=
get_errno
(
sys_statfs
(
path
((
const
char
*
)
arg1
),
stfs
));
ret
=
get_errno
(
statfs
(
path
((
const
char
*
)
arg1
),
&
stfs
));
convert_statfs:
if
(
!
is_error
(
ret
))
{
tswap32s
(
&
stfs
->
f_type
);
tswap32s
(
&
stfs
->
f_bsize
);
tswap32s
(
&
stfs
->
f_blocks
);
tswap32s
(
&
stfs
->
f_bfree
);
tswap32s
(
&
stfs
->
f_bavail
);
tswap32s
(
&
stfs
->
f_files
);
tswap32s
(
&
stfs
->
f_ffree
);
tswap32s
(
&
stfs
->
f_fsid
.
val
[
0
]);
tswap32s
(
&
stfs
->
f_fsid
.
val
[
1
]);
tswap32s
(
&
stfs
->
f_namelen
);
struct
target_statfs
*
target_stfs
=
(
void
*
)
arg2
;
put_user
(
stfs
.
f_type
,
&
target_stfs
->
f_type
);
put_user
(
stfs
.
f_bsize
,
&
target_stfs
->
f_bsize
);
put_user
(
stfs
.
f_blocks
,
&
target_stfs
->
f_blocks
);
put_user
(
stfs
.
f_bfree
,
&
target_stfs
->
f_bfree
);
put_user
(
stfs
.
f_bavail
,
&
target_stfs
->
f_bavail
);
put_user
(
stfs
.
f_files
,
&
target_stfs
->
f_files
);
put_user
(
stfs
.
f_ffree
,
&
target_stfs
->
f_ffree
);
put_user
(
stfs
.
f_fsid
.
__val
[
0
],
&
target_stfs
->
f_fsid
);
put_user
(
stfs
.
f_namelen
,
&
target_stfs
->
f_namelen
);
}
break
;
case
TARGET_NR_fstatfs
:
stfs
=
(
void
*
)
arg2
;
ret
=
get_errno
(
sys_fstatfs
(
arg1
,
stfs
));
ret
=
get_errno
(
fstatfs
(
arg1
,
&
stfs
));
goto
convert_statfs
;
#ifdef TARGET_NR_statfs64
case
TARGET_NR_statfs64
:
ret
=
get_errno
(
statfs
(
path
((
const
char
*
)
arg1
),
&
stfs
));
convert_statfs64:
if
(
!
is_error
(
ret
))
{
struct
target_statfs64
*
target_stfs
=
(
void
*
)
arg3
;
put_user
(
stfs
.
f_type
,
&
target_stfs
->
f_type
);
put_user
(
stfs
.
f_bsize
,
&
target_stfs
->
f_bsize
);
put_user
(
stfs
.
f_blocks
,
&
target_stfs
->
f_blocks
);
put_user
(
stfs
.
f_bfree
,
&
target_stfs
->
f_bfree
);
put_user
(
stfs
.
f_bavail
,
&
target_stfs
->
f_bavail
);
put_user
(
stfs
.
f_files
,
&
target_stfs
->
f_files
);
put_user
(
stfs
.
f_ffree
,
&
target_stfs
->
f_ffree
);
put_user
(
stfs
.
f_fsid
.
__val
[
0
],
&
target_stfs
->
f_fsid
);
put_user
(
stfs
.
f_namelen
,
&
target_stfs
->
f_namelen
);
}
break
;
case
TARGET_NR_fstatfs64
:
ret
=
get_errno
(
fstatfs
(
arg1
,
&
stfs
));
goto
convert_statfs64
;
#endif
#ifdef TARGET_NR_ioperm
case
TARGET_NR_ioperm
:
goto
unimplemented
;
...
...
linux-user/syscall_defs.h
浏览文件 @
56c8f68f
...
...
@@ -1102,6 +1102,68 @@ struct target_stat64 {
#error unsupported CPU
#endif
#ifdef TARGET_MIPS
struct
target_statfs
{
target_long
f_type
;
target_long
f_bsize
;
target_long
f_frsize
;
/* Fragment size - unsupported */
target_long
f_blocks
;
target_long
f_bfree
;
target_long
f_files
;
target_long
f_ffree
;
target_long
f_bavail
;
/* Linux specials */
int
f_fsid
;
target_long
f_namelen
;
target_long
f_spare
[
6
];
};
struct
target_statfs64
{
uint32_t
f_type
;
uint32_t
f_bsize
;
uint32_t
f_frsize
;
/* Fragment size - unsupported */
uint32_t
__pad
;
uint64_t
f_blocks
;
uint64_t
f_bfree
;
uint64_t
f_files
;
uint64_t
f_ffree
;
uint64_t
f_bavail
;
int
f_fsid
;
uint32_t
f_namelen
;
uint32_t
f_spare
[
6
];
};
#else
struct
target_statfs
{
uint32_t
f_type
;
uint32_t
f_bsize
;
uint32_t
f_blocks
;
uint32_t
f_bfree
;
uint32_t
f_bavail
;
uint32_t
f_files
;
uint32_t
f_ffree
;
int
f_fsid
;
uint32_t
f_namelen
;
uint32_t
f_frsize
;
uint32_t
f_spare
[
5
];
};
struct
target_statfs64
{
uint32_t
f_type
;
uint32_t
f_bsize
;
uint64_t
f_blocks
;
uint64_t
f_bfree
;
uint64_t
f_bavail
;
uint64_t
f_files
;
uint64_t
f_ffree
;
int
f_fsid
;
uint32_t
f_namelen
;
uint32_t
f_frsize
;
uint32_t
f_spare
[
5
];
};
#endif
#define TARGET_F_DUPFD 0
/* dup */
#define TARGET_F_GETFD 1
/* get close_on_exec */
#define TARGET_F_SETFD 2
/* set/clear close_on_exec */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录