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
b03c60f3
Commit
b03c60f3
authored
22 years ago
by
Fabrice Bellard
Browse files
Options
Downloads
Patches
Plain Diff
more syscalls
git-svn-id:
svn://svn.savannah.nongnu.org/qemu/trunk@43
c046a42c-6fe2-441c-8c8c-71466251a162
parent
9de5e440
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
TODO
+2
-1
2 additions, 1 deletion
TODO
linux-user/syscall.c
+94
-5
94 additions, 5 deletions
linux-user/syscall.c
with
96 additions
and
6 deletions
TODO
+
2
−
1
View file @
b03c60f3
- optimize translated cache chaining (DLL PLT-like system)
- more syscalls (in particular all 64 bit ones, IPCs, fix 64 bit issues)
- more syscalls (in particular all 64 bit ones, IPCs, fix 64 bit
issues, fix 16 bit uid issues)
- finish signal handing (fp87 state, more siginfo conversions)
- verify thread support (clone() and various locks)
- vm86 syscall support
...
...
This diff is collapsed.
Click to expand it.
linux-user/syscall.c
+
94
−
5
View file @
b03c60f3
...
...
@@ -103,6 +103,10 @@ extern int personality(int);
extern
int
flock
(
int
,
int
);
extern
int
setfsuid
(
int
);
extern
int
setfsgid
(
int
);
extern
int
setresuid
(
int
,
int
,
int
);
extern
int
getresuid
(
int
*
,
int
*
,
int
*
);
extern
int
setresgid
(
int
,
int
,
int
);
extern
int
getresgid
(
int
*
,
int
*
,
int
*
);
static
inline
long
get_errno
(
long
ret
)
{
...
...
@@ -809,6 +813,10 @@ int do_fork(CPUX86State *env, unsigned int flags, unsigned long newsp)
#endif
#define high2lowuid(x) (x)
#define high2lowgid(x) (x)
#define low2highuid(x) (x)
#define low2highgid(x) (x)
void
syscall_init
(
void
)
{
...
...
@@ -913,7 +921,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
ret
=
get_errno
(
umount
((
const
char
*
)
arg1
));
break
;
case
TARGET_NR_setuid
:
ret
=
get_errno
(
setuid
(
arg1
));
ret
=
get_errno
(
setuid
(
low2highuid
(
arg1
))
)
;
break
;
case
TARGET_NR_getuid
:
ret
=
get_errno
(
getuid
());
...
...
@@ -984,7 +992,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
case
TARGET_NR_prof
:
goto
unimplemented
;
case
TARGET_NR_setgid
:
ret
=
get_errno
(
setgid
(
arg1
));
ret
=
get_errno
(
setgid
(
low2highgid
(
arg1
))
)
;
break
;
case
TARGET_NR_getgid
:
ret
=
get_errno
(
getgid
());
...
...
@@ -1727,14 +1735,41 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
}
}
break
;
case
TARGET_NR_setresuid
:
ret
=
get_errno
(
setresuid
(
low2highuid
(
arg1
),
low2highuid
(
arg2
),
low2highuid
(
arg3
)));
break
;
case
TARGET_NR_getresuid
:
{
int
ruid
,
euid
,
suid
;
ret
=
get_errno
(
getresuid
(
&
ruid
,
&
euid
,
&
suid
));
if
(
!
is_error
(
ret
))
{
*
(
uint16_t
*
)
arg1
=
tswap16
(
high2lowuid
(
ruid
));
*
(
uint16_t
*
)
arg2
=
tswap16
(
high2lowuid
(
euid
));
*
(
uint16_t
*
)
arg3
=
tswap16
(
high2lowuid
(
suid
));
}
}
break
;
case
TARGET_NR_setresgid
:
ret
=
get_errno
(
setresgid
(
low2highgid
(
arg1
),
low2highgid
(
arg2
),
low2highgid
(
arg3
)));
break
;
case
TARGET_NR_getresgid
:
{
int
rgid
,
egid
,
sgid
;
ret
=
get_errno
(
getresgid
(
&
rgid
,
&
egid
,
&
sgid
));
if
(
!
is_error
(
ret
))
{
*
(
uint16_t
*
)
arg1
=
high2lowgid
(
tswap16
(
rgid
));
*
(
uint16_t
*
)
arg2
=
high2lowgid
(
tswap16
(
egid
));
*
(
uint16_t
*
)
arg3
=
high2lowgid
(
tswap16
(
sgid
));
}
}
break
;
case
TARGET_NR_vm86
:
case
TARGET_NR_query_module
:
case
TARGET_NR_nfsservctl
:
case
TARGET_NR_setresgid
:
case
TARGET_NR_getresgid
:
case
TARGET_NR_prctl
:
case
TARGET_NR_pread
:
case
TARGET_NR_pwrite
:
...
...
@@ -1789,26 +1824,80 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
break
;
case
TARGET_NR_lchown32
:
ret
=
get_errno
(
lchown
((
const
char
*
)
arg1
,
arg2
,
arg3
));
break
;
case
TARGET_NR_getuid32
:
ret
=
get_errno
(
getuid
());
break
;
case
TARGET_NR_getgid32
:
ret
=
get_errno
(
getgid
());
break
;
case
TARGET_NR_geteuid32
:
ret
=
get_errno
(
geteuid
());
break
;
case
TARGET_NR_getegid32
:
ret
=
get_errno
(
getegid
());
break
;
case
TARGET_NR_setreuid32
:
ret
=
get_errno
(
setreuid
(
arg1
,
arg2
));
break
;
case
TARGET_NR_setregid32
:
ret
=
get_errno
(
setregid
(
arg1
,
arg2
));
break
;
case
TARGET_NR_getgroups32
:
goto
unimplemented
;
case
TARGET_NR_setgroups32
:
goto
unimplemented
;
case
TARGET_NR_fchown32
:
ret
=
get_errno
(
fchown
(
arg1
,
arg2
,
arg3
));
break
;
case
TARGET_NR_setresuid32
:
ret
=
get_errno
(
setresuid
(
arg1
,
arg2
,
arg3
));
break
;
case
TARGET_NR_getresuid32
:
{
int
ruid
,
euid
,
suid
;
ret
=
get_errno
(
getresuid
(
&
ruid
,
&
euid
,
&
suid
));
if
(
!
is_error
(
ret
))
{
*
(
uint32_t
*
)
arg1
=
tswap32
(
ruid
);
*
(
uint32_t
*
)
arg2
=
tswap32
(
euid
);
*
(
uint32_t
*
)
arg3
=
tswap32
(
suid
);
}
}
break
;
case
TARGET_NR_setresgid32
:
ret
=
get_errno
(
setresgid
(
arg1
,
arg2
,
arg3
));
break
;
case
TARGET_NR_getresgid32
:
{
int
rgid
,
egid
,
sgid
;
ret
=
get_errno
(
getresgid
(
&
rgid
,
&
egid
,
&
sgid
));
if
(
!
is_error
(
ret
))
{
*
(
uint32_t
*
)
arg1
=
tswap32
(
rgid
);
*
(
uint32_t
*
)
arg2
=
tswap32
(
egid
);
*
(
uint32_t
*
)
arg3
=
tswap32
(
sgid
);
}
}
break
;
case
TARGET_NR_chown32
:
ret
=
get_errno
(
chown
((
const
char
*
)
arg1
,
arg2
,
arg3
));
break
;
case
TARGET_NR_setuid32
:
ret
=
get_errno
(
setuid
(
arg1
));
break
;
case
TARGET_NR_setgid32
:
ret
=
get_errno
(
setgid
(
arg1
));
break
;
case
TARGET_NR_setfsuid32
:
ret
=
get_errno
(
setfsuid
(
arg1
));
break
;
case
TARGET_NR_setfsgid32
:
ret
=
get_errno
(
setfsgid
(
arg1
));
break
;
case
TARGET_NR_pivot_root
:
goto
unimplemented
;
case
TARGET_NR_mincore
:
goto
unimplemented
;
case
TARGET_NR_madvise
:
goto
unimplemented
;
#if TARGET_LONG_BITS == 32
...
...
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