Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libtcg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anton
libtcg
Commits
72f03900
Commit
72f03900
authored
22 years ago
by
Fabrice Bellard
Browse files
Options
Downloads
Patches
Plain Diff
suppressed clashes
git-svn-id:
svn://svn.savannah.nongnu.org/qemu/trunk@8
c046a42c-6fe2-441c-8c8c-71466251a162
parent
b17780d5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
linux-user/syscall.c
+23
-12
23 additions, 12 deletions
linux-user/syscall.c
linux-user/syscall_defs.h
+1
-1
1 addition, 1 deletion
linux-user/syscall_defs.h
with
24 additions
and
13 deletions
linux-user/syscall.c
+
23
−
12
View file @
72f03900
...
...
@@ -37,7 +37,7 @@
#include
<sched.h>
#include
<sys/socket.h>
#include
<sys/uio.h>
#include
<sys/user.h>
//
#include <sys/user.h>
#define termios host_termios
#define winsize host_winsize
...
...
@@ -52,7 +52,7 @@
#include
"gemu.h"
#define DEBUG
//
#define DEBUG
#ifndef PAGE_SIZE
#define PAGE_SIZE 4096
...
...
@@ -73,18 +73,25 @@ struct dirent {
#endif
#define __NR_sys_uname __NR_uname
#define __NR_sys_getcwd __NR_getcwd
#define __NR_sys_getcwd
1
__NR_getcwd
#define __NR_sys_statfs __NR_statfs
#define __NR_sys_fstatfs __NR_fstatfs
#define __NR_sys_getdents __NR_getdents
#ifdef __NR_gettid
_syscall0
(
int
,
gettid
)
#else
static
int
gettid
(
void
)
{
return
-
ENOSYS
;
}
#endif
_syscall1
(
int
,
sys_uname
,
struct
new_utsname
*
,
buf
)
_syscall2
(
int
,
sys_getcwd
,
char
*
,
buf
,
size_t
,
size
)
_syscall3
(
int
,
getdents
,
uint
,
fd
,
struct
dirent
*
,
dirp
,
uint
,
count
);
_syscall2
(
int
,
sys_getcwd
1
,
char
*
,
buf
,
size_t
,
size
)
_syscall3
(
int
,
sys_
getdents
,
uint
,
fd
,
struct
dirent
*
,
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
statfs
*
,
buf
)
_syscall2
(
int
,
sys_fstatfs
,
int
,
fd
,
struct
statfs
*
,
buf
)
_syscall2
(
int
,
sys_statfs
,
const
char
*
,
path
,
struct
kernel_
statfs
*
,
buf
)
_syscall2
(
int
,
sys_fstatfs
,
int
,
fd
,
struct
kernel_
statfs
*
,
buf
)
static
inline
long
get_errno
(
long
ret
)
{
...
...
@@ -382,7 +389,9 @@ static long do_ioctl(long fd, long cmd, long arg)
ie
++
;
}
arg_type
=
ie
->
arg_type
;
// gemu_log("ioctl: cmd=0x%04lx (%s)\n", cmd, ie->name);
#ifdef DEBUG
gemu_log
(
"ioctl: cmd=0x%04lx (%s)
\n
"
,
cmd
,
ie
->
name
);
#endif
switch
(
arg_type
[
0
])
{
case
TYPE_NULL
:
/* no argument */
...
...
@@ -612,9 +621,11 @@ long do_syscall(int num, long arg1, long arg2, long arg3,
{
long
ret
;
struct
stat
st
;
struct
statfs
*
stfs
;
struct
kernel_
statfs
*
stfs
;
// gemu_log("syscall %d\n", num);
#ifdef DEBUG
gemu_log
(
"syscall %d
\n
"
,
num
);
#endif
switch
(
num
)
{
case
TARGET_NR_exit
:
_exit
(
arg1
);
...
...
@@ -1161,7 +1172,7 @@ long do_syscall(int num, long arg1, long arg2, long arg3,
{
struct
dirent
*
dirp
=
(
void
*
)
arg2
;
long
count
=
arg3
;
ret
=
get_errno
(
getdents
(
arg1
,
dirp
,
count
));
ret
=
get_errno
(
sys_
getdents
(
arg1
,
dirp
,
count
));
if
(
!
is_error
(
ret
))
{
struct
dirent
*
de
;
int
len
=
ret
;
...
...
@@ -1277,7 +1288,7 @@ long do_syscall(int num, long arg1, long arg2, long arg3,
ret
=
get_errno
(
chown
((
const
char
*
)
arg1
,
arg2
,
arg3
));
break
;
case
TARGET_NR_getcwd
:
ret
=
get_errno
(
sys_getcwd
((
char
*
)
arg1
,
arg2
));
ret
=
get_errno
(
sys_getcwd
1
((
char
*
)
arg1
,
arg2
));
break
;
case
TARGET_NR_capget
:
case
TARGET_NR_capset
:
...
...
This diff is collapsed.
Click to expand it.
linux-user/syscall_defs.h
+
1
−
1
View file @
72f03900
...
...
@@ -52,7 +52,7 @@ typedef struct {
int
val
[
2
];
}
kernel_fsid_t
;
struct
statfs
{
struct
kernel_
statfs
{
int
f_type
;
int
f_bsize
;
int
f_blocks
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment