On Fri, Aug 26, 2016 at 7:36 AM, <martin.stre...@gmail.com> wrote: >> Interesting. Maybe we need to change this line in setsig in >> runtime/os_darwin.go >> *(*uintptr)(unsafe.Pointer(&sa.__sigaction_u)) = fn >> to be >> *(*uintptr)(unsafe.Pointer(&sa.__sigaction_u)) = >> unsafe.Pointer(funcPC(sigtramp)) > > > That's not possible, the signatures of sa_tramp and sa_sigaction do not > match: > > /* union for signal handlers */ > union __sigaction_u { > void (*__sa_handler)(int); > void (*__sa_sigaction)(int, struct __siginfo *, void *); > }; > > /* Signal vector template for Kernel user boundary */ > struct __sigaction { > union __sigaction_u __sigaction_u; /* signal handler */ > void (*sa_tramp)(void *, int, int, siginfo_t *, void *); > sigset_t sa_mask; /* signal mask to apply */ > int sa_flags; /* see signal options below */ > };
Good point. OK, then perhaps we need setsig in os_darwin.go to set the sigaction field to a new function, written in assembler, like sigtramp, but taking just the sigaction arguments. And presumably not calling sigreturn. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.