diff --git a/src/include/signals.h b/src/include/signals.h index 1a2a9b396..2fae6c60a 100644 --- a/src/include/signals.h +++ b/src/include/signals.h @@ -4,37 +4,37 @@ typedef void (*sighandler_t)(int); +#ifdef ANDROID typedef struct x64_sigaction_s { + int sa_flags; union { sighandler_t _sa_handler; void (*_sa_sigaction)(int, siginfo_t *, void *); } _u; sigset_t sa_mask; - uint32_t sa_flags; void (*sa_restorer)(void); } x64_sigaction_t; - -typedef struct x64_sigaction_restorer_s { +#else +typedef struct x64_sigaction_s { union { sighandler_t _sa_handler; void (*_sa_sigaction)(int, siginfo_t *, void *); } _u; + sigset_t sa_mask; uint32_t sa_flags; void (*sa_restorer)(void); - sigset_t sa_mask; -} x64_sigaction_restorer_t; +} x64_sigaction_t; +#endif -#ifdef ANDROID -typedef struct android_sigaction_s { - int sa_flags; +typedef struct x64_sigaction_restorer_s { union { sighandler_t _sa_handler; void (*_sa_sigaction)(int, siginfo_t *, void *); } _u; - sigset_t sa_mask; + uint32_t sa_flags; void (*sa_restorer)(void); -} android_sigaction_t; -#endif + sigset_t sa_mask; +} x64_sigaction_restorer_t; #ifdef BOX32 typedef struct __attribute__((packed)) i386_sigaction_s { diff --git a/src/libtools/signals.c b/src/libtools/signals.c index 127f187e8..4abf8a4f8 100644 --- a/src/libtools/signals.c +++ b/src/libtools/signals.c @@ -2064,11 +2064,7 @@ EXPORT sighandler_t my_signal(x64emu_t* emu, int signum, sighandler_t handler) EXPORT sighandler_t my___sysv_signal(x64emu_t* emu, int signum, sighandler_t handler) __attribute__((alias("my_signal"))); EXPORT sighandler_t my_sysv_signal(x64emu_t* emu, int signum, sighandler_t handler) __attribute__((alias("my_signal"))); // not completely exact -#ifdef ANDROID -int EXPORT my_sigaction(x64emu_t* emu, int signum, const android_sigaction_t *act, android_sigaction_t *oldact) -#else int EXPORT my_sigaction(x64emu_t* emu, int signum, const x64_sigaction_t *act, x64_sigaction_t *oldact) -#endif { printf_log(LOG_DEBUG, "Sigaction(signum=%d, act=%p(f=%p, flags=0x%x), old=%p)\n", signum, act, act?act->_u._sa_handler:NULL, act?act->sa_flags:0, oldact); if(signum<0 || signum>MAX_SIGNAL) { @@ -2122,11 +2118,7 @@ int EXPORT my_sigaction(x64emu_t* emu, int signum, const x64_sigaction_t *act, x } return ret; } -#ifdef ANDROID -int EXPORT my___sigaction(x64emu_t* emu, int signum, const android_sigaction_t *act, android_sigaction_t *oldact) -#else int EXPORT my___sigaction(x64emu_t* emu, int signum, const x64_sigaction_t *act, x64_sigaction_t *oldact) -#endif __attribute__((alias("my_sigaction"))); int EXPORT my_syscall_rt_sigaction(x64emu_t* emu, int signum, const x64_sigaction_restorer_t *act, x64_sigaction_restorer_t *oldact, int sigsetsize)