aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/signalvar.h
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2009-11-10 11:46:53 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2009-11-10 11:46:53 +0000
commit75c586a4c8feeed9bc50a07d32247000ca91e114 (patch)
tree917e1b3f029e242c345060d1c391854db34e85ef /sys/sys/signalvar.h
parenta7b890448ca154fad9a3205e6294c362ea92f533 (diff)
downloadsrc-75c586a4c8feeed9bc50a07d32247000ca91e114.tar.gz
src-75c586a4c8feeed9bc50a07d32247000ca91e114.zip
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
Notes
Notes: svn path=/head/; revision=199136
Diffstat (limited to 'sys/sys/signalvar.h')
-rw-r--r--sys/sys/signalvar.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/sys/signalvar.h b/sys/sys/signalvar.h
index c27a1280801b..65d9cf53ef34 100644
--- a/sys/sys/signalvar.h
+++ b/sys/sys/signalvar.h
@@ -330,7 +330,7 @@ void gsignal(int pgid, int sig);
void killproc(struct proc *p, char *why);
void pgsigio(struct sigio **, int signum, int checkctty);
void pgsignal(struct pgrp *pgrp, int sig, int checkctty);
-void postsig(int sig);
+int postsig(int sig);
void psignal(struct proc *p, int sig);
int psignal_event(struct proc *p, struct sigevent *, ksiginfo_t *);
struct sigacts *sigacts_alloc(void);