diff --git a/linux-user/signal.c b/linux-user/signal.c index 9d62e027e3f2..d0b3209a11a6 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -3416,7 +3416,7 @@ struct target_signal_frame { struct rt_signal_frame { siginfo_t info; - struct ucontext uc; + struct ucontext_t uc; uint32_t tramp[2]; }; @@ -3627,7 +3627,7 @@ struct rt_signal_frame { siginfo_t *pinfo; void *puc; siginfo_t info; - struct ucontext uc; + struct ucontext_t uc; uint16_t retcode[4]; /* Trampoline code. */ }; @@ -3924,7 +3924,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka, tswap_siginfo(&frame->info, info); } - /*err |= __clear_user(&frame->uc, offsetof(struct ucontext, uc_mcontext));*/ + /*err |= __clear_user(&frame->uc, offsetof(struct ucontext_t, uc_mcontext));*/ __put_user(0, &frame->uc.tuc_flags); __put_user(0, &frame->uc.tuc_link); __put_user(target_sigaltstack_used.ss_sp, diff --git a/linux-user/strace.c b/linux-user/strace.c index f7a8bf2f7623..f2a69913296b 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include "qemu.h" diff --git a/linux-user/syscall.c b/linux-user/syscall.c index d395f6289794..7bb2e2389c86 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -205,11 +205,11 @@ static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, \ #endif #ifdef __NR_gettid -_syscall0(int, gettid) +//_syscall0(int, gettid) #else /* This is a replacement for the host gettid() and must return a host errno. */ -static int gettid(void) { +int gettid(void) { return -ENOSYS; } #endif @@ -6074,7 +6074,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, time_t host_time; if (get_user_sal(host_time, arg1)) goto efault; - ret = get_errno(stime(&host_time)); + ret = get_errno(time(&host_time)); } break; #endif diff --git a/qga/commands-posix.c b/qga/commands-posix.c index c2ff97021ff5..e6c9f51eec6a 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include diff --git a/qga/main.c b/qga/main.c index f83a97d245a9..400c10154f2a 100644 --- a/qga/main.c +++ b/qga/main.c @@ -289,7 +289,7 @@ static void ga_log(const gchar *domain, GLogLevelFlags level, #else if (level & s->log_level) { #endif - g_get_current_time(&time); + g_get_real_time();//g_get_current_time(&time); fprintf(s->log_file, "%lu.%lu: %s: %s\n", time.tv_sec, time.tv_usec, level_str, msg); fflush(s->log_file); diff --git a/tests/tcg/test-i386.c b/tests/tcg/test-i386.c index b05572b73422..2d596af1b014 100644 --- a/tests/tcg/test-i386.c +++ b/tests/tcg/test-i386.c @@ -1720,7 +1720,7 @@ int tab[2]; void sig_handler(int sig, siginfo_t *info, void *puc) { - struct ucontext *uc = puc; + struct ucontext_t *uc = puc; printf("si_signo=%d si_errno=%d si_code=%d", info->si_signo, info->si_errno, info->si_code); @@ -1912,7 +1912,7 @@ void test_exceptions(void) /* specific precise single step test */ void sig_trap_handler(int sig, siginfo_t *info, void *puc) { - struct ucontext *uc = puc; + struct ucontext_t *uc = puc; printf("EIP=" FMTLX "\n", (long)uc->uc_mcontext.gregs[REG_EIP]); } diff --git a/user-exec.c b/user-exec.c index 8ad89a466b1b..2cfbf675a39f 100644 --- a/user-exec.c +++ b/user-exec.c @@ -23,6 +23,7 @@ #include "qemu/bitops.h" #include "exec/cpu_ldst.h" #include "translate-all.h" +#include #undef EAX #undef ECX @@ -58,7 +59,7 @@ static void exception_action(CPUState *cpu) void cpu_resume_from_signal(CPUState *cpu, void *puc) { #ifdef __linux__ - struct ucontext *uc = puc; + struct ucontext_t *uc = puc; #elif defined(__OpenBSD__) struct sigcontext *uc = puc; #endif @@ -172,7 +173,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, #elif defined(__OpenBSD__) struct sigcontext *uc = puc; #else - struct ucontext *uc = puc; + struct ucontext_t *uc = puc; #endif unsigned long pc; int trapno; @@ -227,7 +228,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, #elif defined(__OpenBSD__) struct sigcontext *uc = puc; #else - struct ucontext *uc = puc; + struct ucontext_t *uc = puc; #endif pc = PC_sig(uc); @@ -289,7 +290,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, #ifdef __APPLE__ #include -typedef struct ucontext SIGCONTEXT; +typedef struct ucontext_t SIGCONTEXT; /* All Registers access - only for local access */ #define REG_sig(reg_name, context) \ ((context)->uc_mcontext->ss.reg_name) @@ -332,7 +333,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) ucontext_t *uc = puc; #else - struct ucontext *uc = puc; + struct ucontext_t *uc = puc; #endif unsigned long pc; int is_write; @@ -359,7 +360,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, void *puc) { siginfo_t *info = pinfo; - struct ucontext *uc = puc; + struct ucontext_t *uc = puc; uint32_t *pc = uc->uc_mcontext.sc_pc; uint32_t insn = *pc; int is_write = 0; @@ -457,7 +458,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, #if defined(__NetBSD__) ucontext_t *uc = puc; #else - struct ucontext *uc = puc; + struct ucontext_t *uc = puc; #endif unsigned long pc; int is_write; @@ -484,7 +485,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, int cpu_signal_handler(int host_signum, void *pinfo, void *puc) { siginfo_t *info = pinfo; - struct ucontext *uc = puc; + struct ucontext_t *uc = puc; uintptr_t pc = uc->uc_mcontext.pc; uint32_t insn = *(uint32_t *)pc; bool is_write; @@ -513,7 +514,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, void *puc) { siginfo_t *info = pinfo; - struct ucontext *uc = puc; + struct ucontext_t *uc = puc; unsigned long pc; int is_write; @@ -535,7 +536,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, int cpu_signal_handler(int host_signum, void *pinfo, void *puc) { siginfo_t *info = pinfo; - struct ucontext *uc = puc; + struct ucontext_t *uc = puc; unsigned long ip; int is_write = 0; @@ -566,7 +567,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, void *puc) { siginfo_t *info = pinfo; - struct ucontext *uc = puc; + struct ucontext_t *uc = puc; unsigned long pc; uint16_t *pinsn; int is_write = 0; @@ -619,7 +620,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, void *puc) { siginfo_t *info = pinfo; - struct ucontext *uc = puc; + struct ucontext_t *uc = puc; greg_t pc = uc->uc_mcontext.pc; int is_write; @@ -635,7 +636,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, void *puc) { siginfo_t *info = pinfo; - struct ucontext *uc = puc; + struct ucontext_t *uc = puc; unsigned long pc = uc->uc_mcontext.sc_iaoq[0]; uint32_t insn = *(uint32_t *)pc; int is_write = 0; diff --git a/util/memfd.c b/util/memfd.c index 7c406914c592..1f3de7279bd6 100644 --- a/util/memfd.c +++ b/util/memfd.c @@ -40,7 +40,7 @@ #include #include -static int memfd_create(const char *name, unsigned int flags) +int memfd_create(const char *name, unsigned int flags) { #ifdef __NR_memfd_create return syscall(__NR_memfd_create, name, flags);