qemu/qemu-cvs-gettimeofday.patch

35 lines
1.6 KiB
Diff
Raw Normal View History

Index: qemu/linux-user/syscall.c
===================================================================
--- qemu.orig/linux-user/syscall.c
+++ qemu/linux-user/syscall.c
@@ -3596,6 +3596,7 @@ long do_syscall(void *cpu_env, int num,
case TARGET_NR_gettimeofday:
{
struct timeval tv;
+ target_to_host_timeval(&tv, arg1);
ret = get_errno(gettimeofday(&tv, NULL));
if (!is_error(ret)) {
host_to_target_timeval(arg1, &tv);
Index: qemu/linux-user/signal.c
===================================================================
--- qemu.orig/linux-user/signal.c
+++ qemu/linux-user/signal.c
@@ -207,6 +207,8 @@ static inline void host_to_target_siginf
/* should never come here, but who knows. The information for
the target is irrelevant */
tinfo->_sifields._sigfault._addr = 0;
+ } else if (sig == SIGIO) {
+ tinfo->_sifields._sigpoll._fd = info->si_fd;
} else if (sig >= TARGET_SIGRTMIN) {
tinfo->_sifields._rt._pid = info->si_pid;
tinfo->_sifields._rt._uid = info->si_uid;
@@ -228,6 +230,8 @@ static void tswap_siginfo(target_siginfo
sig == SIGBUS || sig == SIGTRAP) {
tinfo->_sifields._sigfault._addr =
tswapl(info->_sifields._sigfault._addr);
+ } else if (sig == SIGIO) {
+ tinfo->_sifields._sigpoll._fd = tswap32(info->_sifields._sigpoll._fd);
} else if (sig >= TARGET_SIGRTMIN) {
tinfo->_sifields._rt._pid = tswap32(info->_sifields._rt._pid);
tinfo->_sifields._rt._uid = tswap32(info->_sifields._rt._uid);