summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sig.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* move knote list to struct process. ok guenthertedu2010-05-181-4/+4
|
* Convert thrsigdivert to (almost) be sigtimedwait by adding siginfo_tguenther2009-11-271-3/+29
| | | | | | | and struct timespec * argument. sigtimedwait is just a one line wrapper after this. "get it in" deraadt@, tedu@, cheers by others
* Get rid of __HAVE_GENERIC_SOFT_INTERRUPTS now that all our platforms support it.kettenis2009-11-041-7/+2
| | | | ok jsing@, miod@
* We need miod's no-coredumps-on-ramdisks diff, because we have grown thederaadt2009-06-061-1/+11
| | | | media just a wee bit too much.
* %zu is not meant for size_t in the kernel. Change to %lu.ray2009-06-051-2/+2
| | | | OK miod
* Make ELF platforms generate ELF core dumps. Somewhat based on code fromkettenis2009-03-051-10/+57
| | | | | | NetBSD. ok kurt@, drahn@, miod@
* Remove KASSERT() that could trigger when an rthread in sigwait()guenther2009-01-291-4/+3
| | | | | | | | | got multiple signals before tsleep() could wakeup. Also, POSIX says that sigwait() should never return EINTR, so map that to ERESTART. ok kurt@, tedu@ fixes the panic encountered by ariane@ with kaffe
* Move the functionality of psignal() to a new function ptsignal()guenther2008-12-161-28/+64
| | | | | | | | | | | | | that takes an additional argument "type" that indicates whether the signal is for the process, just a particular thread, or propagated to a thread because it's not caught or blocked. psignal() becomes a wrapper that does the first of those. So that sys_kill() can tell apart signals for the process and signals for the process's original thread, the tid of the original thread is defined as its pid + THREAD_PID_OFFSET. ok tedu@ art@ andreas@ kurt@ "better early than late" deraadt@
* Make sigwait() work correctly. In particular, it'll work when theguenther2008-10-031-6/+47
| | | | | | | | | | | | | signal is already pending in the calling thread or the main thread and there's no longer a race condition where the signal could be diverted but sigwait() would still block. There were some off-by-one errors too. (The checking of the main thread's pending list is just until a pending list for the process can be added to struct process. For now, such signals end up as pending on the main thread.) oks tedu@ and art@
* posix compliant permission checks for sending signals. Based on diffshshoexer2008-06-101-11/+3
| | | | | | | provided by christian ehrhardt (Christian_Ehrhardt@genua.de) and micky, thanks! ok deraadt millert
* Use LIST_FOREACH() instead of handrolling.thib2008-05-221-2/+2
| | | | | From: Pierre Riteau pierre.riteau_att_gmail.com OK miod@
* typos; ok jmc@martynas2007-11-271-2/+2
| | | | sys/dev/pci/pciide.c from naddy@
* Don't overwrite a core file owned by a different user. Makes the codemillert2007-11-191-3/+3
| | | | match the comment. OK deraadt@
* replace the machine dependant bytes-to-clicks macro by the MI ptoa()martin2007-09-011-5/+5
| | | | | | | | version for i386 more architectures and ctob() replacement is being worked on prodded by and ok miod
* Adjust filename buffer for the new /var/crash prefix to preventmoritz2007-05-301-4/+7
| | | | | | truncation and add an additional truncation check. ok deraadt@ tedu@
* update comment re nosuidcoredump sysctljcs2007-05-291-2/+3
| | | | ok tedu
* put suid coredumps into /var/crash if kern.nosuidcoredump is set to 2.tedu2007-05-291-7/+10
| | | | | makes debugging easier, docs in a bit ok beck deraadt
* Needs an extern decl for generic soft interrupts platforms.miod2007-05-081-1/+4
|
* First step in making the SCHED_LOCK not recursive.art2007-05-081-20/+60
| | | | | | | | | | | | | | | - Defer the sending of SIGCHLD and waking the parent when a process goes to sleep. We set a flag in the process "P_STOPPED" and schedule a timeout that checks all processes for this flag and sends SIGCHLD and wakes the parent on those processes that have this flag set. - Delay the waking of the parent in psignal on SIGCONT until we've released the SCHED_LOCK at the end. - In issignal, check for P_SINTR as a way to see we were called from the tsleep path with SCHED_LOCK locked and don't skip locking in that case. (This is slightly ugly, but it works until we have some better way). miod@ ok (after finding and fixing an MD bug on sgi)
* Start moving state that is shared among threads in a process intoart2007-04-031-8/+16
| | | | | | | | | | | a new struct. Instead of doing a huge rename and deal with the fallout for weeks, like other projects that need no mention, we will slowly and carefully move things out of struct proc into a new struct process. - Create struct process and the infrastructure to create and remove them. - Move threads in a process into struct process. deraadt@, tedu@ ok
* Since p_flag is often manipulated in interrupts and without biglockart2007-03-151-10/+10
| | | | | | | | | | | | 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
* Use atomic.h operation for manipulating p_siglist in struct proc. Solvesart2007-02-061-14/+16
| | | | | | the problem with lost signals in MP kernels. miod@, kettenis@ ok
* When sending signals, instead of checking if the process sending theart2007-01-171-3/+4
| | | | | | | | | | | 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
* Retire VOP_LEASE(); It was a bit for NQNFS and hasthib2007-01-161-2/+1
| | | | | | | | | 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)
* Nothing sets P_FSTRACE anymore, so remove all what's left of it.miod2006-06-151-16/+4
|
* killproc() is orphaned, so kill it; ok deraadt@miod2006-06-071-15/+1
|
* Remove traditional coredump support since all our platforms have propermiod2006-03-041-37/+11
| | | | cpu_coredump() behaviour.
* Compile out more rthreads stuff unless option RTHREADS;miod2006-02-201-2/+11
| | | | discussed with a few, ok tedu@
* Fix logic botch when checking for COMPAT_SUNOS binary specifics; repairsmiod2006-01-181-5/+7
| | | | | some TIOCGPGRP result fallout. ok deraadt@
* 1. when signalling a process group, don't deliver a copy to every threadtedu2005-12-221-3/+9
| | | | | | | 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.
* kernel support for threaded processes (rthreads).tedu2005-12-031-2/+28
| | | | | | | | 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
* ansi/deregister.jsg2005-11-281-116/+53
| | | | 'go for it' deraadt@
* A second approach at fixing the telnet localhost & problemniklas2005-06-171-26/+8
| | | | | | | | | | | | | | (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@
* sched work by niklas and art backed out; causes panicsderaadt2005-05-291-21/+42
|
* This patch is mortly art's work and was done *a year* ago. Art wants to thankniklas2005-05-251-42/+21
| | | | | | | | | | | | | | | | 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.
* Use list and queue macros where applicable to make the code easier to read;miod2004-12-261-5/+4
| | | | no change in compiler assembly output.
* proc_stop needs sched_lock locked. From art, verified with NetBSD.niklas2004-07-041-2/+2
|
* debranch SMP, have funniklas2004-06-131-8/+42
|
* fix siginfo generation for posted signals and avoid double ktrpsig() call for the same signal; deraadt@ okmickey2004-04-061-17/+28
|
* change sigaltstack.ss_size type to size_t. handle syscall fallout.tedu2004-01-141-3/+48
| | | | | add stack_t and ucontext_t typedefs. ok deraadt@
* match syscallargs comments with realityhenning2003-09-011-3/+3
| | | | | from Patrick Latifi <patrick.l@hermes.usherb.ca> ok jason@ tedu@
* change arguments to suser. suser now takes the process, and a flagstedu2003-08-151-2/+2
| | | | | | | | | 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@
* Use strlcpy(), not strncpy() when copying p->p_comm to core.c_namemillert2003-08-041-2/+2
| | | | to guarantee NUL termination; from Patrick Latifi.
* Implement the WCONTINUED flag to the wait(2) family of syscalls and themillert2003-08-031-2/+6
| | | | | | | | | 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.
* remove caddr_t casts. it's just silly to cast something when the functiontedu2003-07-211-11/+9
| | | | takes a void *. convert uiomove to take a void * as well. ok deraadt@
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* string fixes; tedu okderaadt2003-05-031-2/+2
|
* Oppsie. Missing part from this commit:art2002-10-011-3/+3
| | | | | | | | 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
* be more permissive, and let close relatives do SIGALRMderaadt2002-07-141-1/+2
|
* Protect mi_switch with splstatclock.art2002-06-111-4/+8
|