aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/signal.h
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2009-11-17 11:39:15 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2009-11-17 11:39:15 +0000
commita3de221dbeab3188b41cdbcd4c475242fc7fd046 (patch)
treec59c7fddba5c77496f61d018fe1c5c004cf33224 /sys/sys/signal.h
parent5b412ffb6b23e5f9702c3115a88556af4b35d990 (diff)
downloadsrc-a3de221dbeab3188b41cdbcd4c475242fc7fd046.tar.gz
src-a3de221dbeab3188b41cdbcd4c475242fc7fd046.zip
Among signal generation syscalls, only sigqueue(2) is allowed by POSIX
to fail due to lack of resources to queue siginfo. Add KSI_SIGQ flag that allows sigqueue_add() to fail while trying to allocate memory for new siginfo. When the flag is not set, behaviour is the same as for KSI_TRAP: if memory cannot be allocated, set bit in sq_kill. KSI_TRAP is kept to preserve KBI. Add SI_KERNEL si_code, to be used in siginfo.si_code when signal is generated by kernel. Deliver siginfo when signal is generated by kill(2) family of syscalls (SI_USER with properly filled si_uid and si_pid), or by kernel (SI_KERNEL, mostly job control or SIGIO). Since KSI_SIGQ flag is not set for the ksi, low memory condition cause old behaviour. Keep psignal(9) KBI intact, but modify it to generate SI_KERNEL si_code. Pgsignal(9) and gsignal(9) now take ksi explicitely. Add pksignal(9) that behaves like psignal but takes ksi, and ddb kill command implemented as pksignal(..., ksi = NULL) to not do allocation while in debugger. While there, remove some register specifiers and use ANSI C prototypes. Reviewed by: davidxu MFC after: 1 month
Notes
Notes: svn path=/head/; revision=199355
Diffstat (limited to 'sys/sys/signal.h')
-rw-r--r--sys/sys/signal.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/sys/signal.h b/sys/sys/signal.h
index e90b107d170d..81d45a9cc425 100644
--- a/sys/sys/signal.h
+++ b/sys/sys/signal.h
@@ -338,6 +338,7 @@ struct sigaction {
/* an asynchronous I/O request.*/
#define SI_MESGQ 0x10005 /* Signal generated by arrival of a */
/* message on an empty message queue. */
+#define SI_KERNEL 0x10006
#endif
#if __BSD_VISIBLE
#define SI_UNDEFINED 0