Konstantin Belousov 75c586a4c8 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
2009-11-10 11:46:53 +00:00
..
2009-06-25 12:46:59 +00:00
2009-11-04 15:24:32 +00:00
2006-08-16 09:34:56 +00:00
2009-01-01 02:08:56 +00:00
2009-01-01 02:08:56 +00:00
2009-05-27 16:36:54 +00:00
2009-11-03 20:22:09 +00:00
2009-01-01 02:29:17 +00:00
2009-05-09 19:01:24 +00:00
2006-09-22 22:11:29 +00:00
2009-09-19 17:56:26 +00:00
2009-10-23 15:10:41 +00:00
2009-01-01 02:11:01 +00:00
2007-02-06 16:24:57 +00:00
2009-11-06 07:17:31 +00:00
2009-10-02 11:14:12 +00:00
2008-09-22 10:37:02 +00:00
2006-11-11 16:19:12 +00:00
2008-07-23 16:44:20 +00:00
2009-10-27 11:01:40 +00:00
2009-10-27 11:01:40 +00:00
2009-10-27 11:01:40 +00:00
2009-05-07 13:49:48 +00:00
2006-03-01 06:48:31 +00:00
2009-03-01 04:57:23 +00:00
2009-09-06 10:27:45 +00:00
2009-09-06 09:39:40 +00:00
2009-08-23 08:04:40 +00:00
2009-06-25 12:46:59 +00:00