summaryrefslogtreecommitdiff
path: root/sys/kern/kern_sig.c
AgeCommit message (Collapse)Author
2007-03-15Since p_flag is often manipulated in interrupts and without biglockArtur Grabowski
it's a good idea to use atomic.h operations on it. This mechanic change updates all bit operations on p_flag to atomic_{set,clear}bits_int. Only exception is that P_OWEUPC is set by MI code before calling need_proftick and it's automatically cleared by ADDUPC. There's no reason for MD handling of that flag since everyone handles it the same way. kettenis@ ok
2007-02-06Use atomic.h operation for manipulating p_siglist in struct proc. SolvesArtur Grabowski
the problem with lost signals in MP kernels. miod@, kettenis@ ok
2007-01-17When sending signals, instead of checking if the process sending theArtur Grabowski
signal to is the curproc, check if it's SONPROC. That way we'll also signotify processes on other CPUs. This gives MD code the opportunity to actually deliver signals to other CPUs faster than the clock interrupt (in the worst case). This is a NOP until MD code is fixed. miod@ ok
2007-01-16Retire VOP_LEASE(); It was a bit for NQNFS and hasThordur I. Bjornsson
effectively been a no-op for quite some time now, without promise for future usage. ok pedro@ Testing by krw@ (earlier diff) and Johan Mson Lindman (tybollt@solace.miun.se)
2006-06-15Nothing sets P_FSTRACE anymore, so remove all what's left of it.Miod Vallat
2006-06-07killproc() is orphaned, so kill it; ok deraadt@Miod Vallat
2006-03-04Remove traditional coredump support since all our platforms have properMiod Vallat
cpu_coredump() behaviour.
2006-02-20Compile out more rthreads stuff unless option RTHREADS;Miod Vallat
discussed with a few, ok tedu@
2006-01-18Fix logic botch when checking for COMPAT_SUNOS binary specifics; repairsMiod Vallat
some TIOCGPGRP result fallout. ok deraadt@
2005-12-221. when signalling a process group, don't deliver a copy to every threadTed Unangst
2. when delivering a STOP or CONT signal to a process, now replicate to every thread. makes ^Z and fg work nicer, first noticed by peter hessler. signals and threads are not right, but this is at least a little less wrong.
2005-12-03kernel support for threaded processes (rthreads).Ted Unangst
uses rfork(RFTHREAD) to create threads, which are presently processes that are a little more tightly bound together. several new syscalls added to facilitate a userland thread library. all conditional on RTHREADS, currently disabled. ok deraadt
2005-11-28ansi/deregister.Jonathan Gray
'go for it' deraadt@
2005-06-17A second approach at fixing the telnet localhost & problemNiklas Hallqvist
(but I tend to call it ssh localhost & now when telnetd is history). This is more localized patch, but leaves us with a recursive lock for protecting scheduling and signal state. Better care is taken to actually be symmetric over mi_switch. Also, the dolock cruft in psignal can go with this solution. Better test runs by more people for longer time has been carried out compared to the c2k5 patch. Long term the current mess with interruptible sleep, the default action on stop signals and wakeup interactions need to be revisited. ok deraadt@, art@
2005-05-29sched work by niklas and art backed out; causes panicsTheo de Raadt
2005-05-25This patch is mortly art's work and was done *a year* ago. Art wants to thankNiklas Hallqvist
everyone for the prompt review and ok of this work ;-) Yeah, that includes me too, or maybe especially me. I am sorry. Change the sched_lock to a mutex. This fixes, among other things, the infamous "telnet localhost &" problem. The real bug in that case was that the sched_lock which is by design a non-recursive lock, was recursively acquired, and not enough releases made us hold the lock in the idle loop, blocking scheduling on the other processors. Some of the other processors would hold the biglock though, which made it impossible for cpu 0 to enter the kernel... A nice deadlock. Let me just say debugging this for days just to realize that it was all fixed in an old diff noone ever ok'd was somewhat of an anti-climax. This diff also changes splsched to be correct for all our architectures.
2004-12-26Use list and queue macros where applicable to make the code easier to read;Miod Vallat
no change in compiler assembly output.
2004-07-04proc_stop needs sched_lock locked. From art, verified with NetBSD.Niklas Hallqvist
2004-06-13debranch SMP, have funNiklas Hallqvist
2004-04-06fix siginfo generation for posted signals and avoid double ktrpsig() call ↵Michael Shalayeff
for the same signal; deraadt@ ok
2004-01-14change sigaltstack.ss_size type to size_t. handle syscall fallout.Ted Unangst
add stack_t and ucontext_t typedefs. ok deraadt@
2003-09-01match syscallargs comments with realityHenning Brauer
from Patrick Latifi <patrick.l@hermes.usherb.ca> ok jason@ tedu@
2003-08-15change arguments to suser. suser now takes the process, and a flagsTed Unangst
argument. old cred only calls user suser_ucred. this will allow future work to more flexibly implement the idea of a root process. looks like something i saw in freebsd, but a little different. use of suser_ucred vs suser in file system code should be looked at again, for the moment semantics remain unchanged. review and input from art@ testing and further review miod@
2003-08-04Use strlcpy(), not strncpy() when copying p->p_comm to core.c_nameTodd C. Miller
to guarantee NUL termination; from Patrick Latifi.
2003-08-03Implement the WCONTINUED flag to the wait(2) family of syscalls and theTodd C. Miller
associated WIFCONTINUED macro as per 1003.1-2001. Adapted from FreeBSD. A minor amount of trickiness is involved here. The value for WCONTINUED is chosen in such a way that _WSTATUS(_WCONTINUED) == _WSTOPPED and the WIFSTOPPED macro has been modified such that WIFSTOPPED(_WCONTINUED) != _WSTOPPED. This means we don't need to add an extra check to the WIFSIGNALED and WIFSTOPPED macros. deraadt@ OK.
2003-07-21remove caddr_t casts. it's just silly to cast something when the functionTed Unangst
takes a void *. convert uiomove to take a void * as well. ok deraadt@
2003-06-02Remove the advertising clause in the UCB license which BerkeleyTodd C. Miller
rescinded 22 July 1999. Proofed by myself and Theo.
2003-05-03string fixes; tedu okTheo de Raadt
2002-10-01Oppsie. Missing part from this commit:Artur Grabowski
Prevent two localhost crashes with proc filters. - don't send NOTE_SIGNAL to exiting processes. - null dereference on error condition. from Peter Werner <peterw at ifost.org.au> deraadt@ ok
2002-07-14be more permissive, and let close relatives do SIGALRMTheo de Raadt
2002-06-11Protect mi_switch with splstatclock.Artur Grabowski
2002-05-08A process can always signal itself--no need to restrict signals even ifTodd C. Miller
it is setugid. deraadt@ ok
2002-04-18Provide the correct signal number to the ktrace PSIG information insteadMiod Vallat
of an uninitialized variable. millert@ ok
2002-03-14First round of __P removal in sysTodd C. Miller
2002-02-22include a siginfo_t with ktrace PSIG information, so that kdump can printTheo de Raadt
fault addresses and other information. (a small bug exists: in some signal delivery cases, two PSIG records may be inserted, because postsig() is unaware a PSIG record has already been placed. but this small bug can stay since the siginfo_t information helps us find and fix other bugs)
2002-01-31Ignore signals if/when we are exiting.Tobias Weingartner
Prevents a hang in the NFS code when dumping core and pressing ^C, etc. ok art@
2002-01-23Pool deals fairly well with physical memory shortage, but it doesn't dealArtur Grabowski
well (not at all) with shortages of the vm_map where the pages are mapped (usually kmem_map). Try to deal with it: - group all information the backend allocator for a pool in a separate struct. The pool will only have a pointer to that struct. - change the pool_init API to reflect that. - link all pools allocating from the same allocator on a linked list. - Since an allocator is responsible to wait for physical memory it will only fail (waitok) when it runs out of its backing vm_map, carefully drain pools using the same allocator so that va space is freed. (see comments in code for caveats and details). - change pool_reclaim to return if it actually succeeded to free some memory, use that information to make draining easier and more efficient. - get rid of PR_URGENT, noone uses it.
2002-01-19If handler for SIGCHLD is SIG_IGN, reset to SIG_DLF. This is consistentTodd C. Miller
with our handling of SA_NOCLDWAIT as well as other operating systems. From FreeBSD.
2002-01-07If the handler for SIGCHLD is set to SIG_IGN, act as if theTodd C. Miller
SA_NOCLDWAIT (don't create zombies) flag has been specified. This is consistent with most other operating systems and is what XPG4.2 specifies.
2001-11-06Replace inclusion of <vm/foo.h> with the correct <uvm/bar.h> when necessary.Miod Vallat
(Look ma, I might have broken the tree)
2001-09-21execsigs() could modify the wrong sigacts; based on David.Arana@eng.sun.com ↵Theo de Raadt
saying he could not understand how this worked
2001-09-20cosmetic.Artur Grabowski
2001-08-09Unshare signal actions on exec, from NetBSD. While I am here a little KNF ↵Niklas Hallqvist
nit too
2001-06-27remove old vmArtur Grabowski
2001-06-22KNFTheo de Raadt
2001-06-18trace_req is a nop.Artur Grabowski
rename stop -> proc_stop (stop is not a good function name).
2001-05-16kill COMPAT_{09,10,11} kernel options. We still need kern_info_09.c and ↵Todd C. Miller
kern_ipc_10.c for other compat modules.
2001-04-02On popular demand, the Linux-compatibility clone(2) implementation basedNiklas Hallqvist
on NetBSD's code, as well as some faked Posix RT extensions by me. This makes at least simple linuxthreads tests work.
2001-02-19Clean up spl handling.Artur Grabowski
2000-11-16support kernel event queues, from FreeBSD by Jonathan Lemon,Niels Provos
okay art@, millert@
2000-11-10Change the ktrace interface functions from taking the trace vnode to taking theArtur Grabowski
traced proc. The vnode is in the proc and all functions need the proc.