--- qemu-snapshot-2004-12-17_23/Makefile.target.orig 2004-12-12 08:56:30.000000000 -0800 +++ qemu-snapshot-2004-12-17_23/Makefile.target 2004-12-19 05:48:08.000000000 -0800 @@ -264,7 +264,7 @@ endif # must use static linking to avoid leaving stuff in virtual address space -VL_OBJS=vl.o osdep.o block.o readline.o monitor.o pci.o console.o +VL_OBJS=vl.o osdep.o block.o readline.o monitor.o pci.o console.o __restore.o VL_OBJS+=block-cow.o block-qcow.o aes.o block-vmdk.o block-cloop.o block-dmg.o SOUND_HW = sb16.o --- qemu-snapshot-2004-12-17_23/__restore.S.orig 2004-12-19 05:44:53.000000000 -0800 +++ qemu-snapshot-2004-12-17_23/__restore.S 2004-12-18 20:34:14.000000000 -0800 @@ -0,0 +1,10 @@ +#include + +__restore: .globl __restore + pop %eax + movl $ __NR_sigreturn,%eax + int $0x80 + +__restore_rt: .globl __restore_rt + movl $ __NR_rt_sigreturn,%eax + int $0x80 --- qemu-snapshot-2004-12-17_23/osdep.c.orig 2004-08-03 15:09:30.000000000 -0700 +++ qemu-snapshot-2004-12-17_23/osdep.c 2004-12-19 15:44:08.000000000 -0800 @@ -153,9 +153,25 @@ QEMU_SYSCALL4(rt_sigaction, signum, act, oldact, sigsetsize); } -int qemu_sigaction(int signum, const struct qemu_sigaction *act, +int qemu_sigaction(int signum, struct qemu_sigaction *act, struct qemu_sigaction *oldact) { +#define SA_RESTORER 0x04000000 + if (!(act->sa_flags & SA_RESTORER)) { + /* Required for Linux 2.6.x "no-exec stack": kernel does not + * push trampoline instructions for handler return, + * so user-mode code must supply the correct .sa_restorer. + */ + extern void __restore(void); + extern void __restore_rt(void); + act->sa_flags |= SA_RESTORER; + if (act->sa_flags & SA_SIGINFO) { + act->sa_restorer = __restore_rt; + } + else { + act->sa_restorer = __restore; + } + } return kernel_sigaction(signum, act, oldact, 8); } --- qemu-snapshot-2004-12-17_23/osdep.h.orig 2004-08-03 15:09:30.000000000 -0700 +++ qemu-snapshot-2004-12-17_23/osdep.h 2004-12-19 15:43:54.000000000 -0800 @@ -35,7 +35,7 @@ sigset_t sa_mask; /* mask last for extensibility */ }; -int qemu_sigaction(int signum, const struct qemu_sigaction *act, +int qemu_sigaction(int signum, struct qemu_sigaction *act, struct qemu_sigaction *oldact); #undef sigaction