From 2d08f816e13d4eca3a96eb24f578541791a335e7 Mon Sep 17 00:00:00 2001 From: kib Date: Tue, 17 Nov 2009 11:39:15 +0000 Subject: 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 --- sys/ddb/db_command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/ddb') diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c index 1e34016..73de0c5 100644 --- a/sys/ddb/db_command.c +++ b/sys/ddb/db_command.c @@ -652,7 +652,7 @@ db_kill(dummy1, dummy2, dummy3, dummy4) if (PROC_TRYLOCK(p) == 0) DB_ERROR(("Can't lock process with pid %ld\n", (long) pid)); else { - psignal(p, sig); + pksignal(p, sig, NULL); PROC_UNLOCK(p); } -- cgit v1.1