Date: Tue, 10 Nov 2009 11:46:53 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: cvs-src-old@freebsd.org Subject: cvs commit: src/sys/kern kern_sig.c src/sys/sys signalvar.h Message-ID: <200911101147.nAABlGjU060839@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
kib 2009-11-10 11:46:53 UTC FreeBSD src repository Modified files: sys/kern kern_sig.c sys/sys signalvar.h Log: SVN rev 199136 on 2009-11-10 11:46:53Z by kib In r198506, kern_sigsuspend() started doing cursig/postsig loop to make sure that a signal was delivered to the thread before returning from syscall. Signal delivery puts new return frame on the user stack, and modifies trap frame to enter signal handler. As a consequence, syscall return code sets EINTR as error return for signal frame, instead of the syscall return. Also, for ia64, due to different registers layout for those two kind of frames, usermode sigsegfaulted when returned from signal handler. Use newly-introduced cpu_set_syscall_retval(9) to set syscall result, and return EJUSTRETURN from kern_sigsuspend() to prevent syscall return code from modifying this frame [1]. Another issue is that pending SIGCONT might be cancelled by SIGSTOP, causing postsig() not to deliver any catched signal [2]. Modify postsig() to return 1 if signal was posted, and 0 otherwise, and use this in the kern_sigsuspend loop. Proposed by: marcel [1] Noted by: davidxu [2] Reviewed by: marcel, davidxu MFC after: 1 month Revision Changes Path 1.382 +7 -8 src/sys/kern/kern_sig.c 1.83 +1 -1 src/sys/sys/signalvar.h
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911101147.nAABlGjU060839>