]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
1. Change prototype of trapsignal and sendsig to use ksiginfo_t *, most
authordavidxu <davidxu@FreeBSD.org>
Fri, 14 Oct 2005 12:43:47 +0000 (12:43 +0000)
committerdavidxu <davidxu@FreeBSD.org>
Fri, 14 Oct 2005 12:43:47 +0000 (12:43 +0000)
commit3fbdb3c21524d9d95278ada1d61b4d1e6bee654b
tree95d82b1a11b0c187223f8ac12f020b19901fa750
parent6b2407fb7677ef2b8cef5c0925b3fe88a6ec7ca4
1. Change prototype of trapsignal and sendsig to use ksiginfo_t *, most
   changes in MD code are trivial, before this change, trapsignal and
   sendsig use discrete parameters, now they uses member fields of
   ksiginfo_t structure. For sendsig, this change allows us to pass
   POSIX realtime signal value to user code.

2. Remove cpu_thread_siginfo, it is no longer needed because we now always
   generate ksiginfo_t data and feed it to libpthread.

3. Add p_sigqueue to proc structure to hold shared signals which were
   blocked by all threads in the proc.

4. Add td_sigqueue to thread structure to hold all signals delivered to
   thread.

5. i386 and amd64 now return POSIX standard si_code, other arches will
   be fixed.

6. In this sigqueue implementation, pending signal set is kept as before,
   an extra siginfo list holds additional siginfo_t data for signals.
   kernel code uses psignal() still behavior as before, it won't be failed
   even under memory pressure, only exception is when deleting a signal,
   we should call sigqueue_delete to remove signal from sigqueue but
   not SIGDELSET. Current there is no kernel code will deliver a signal
   with additional data, so kernel should be as stable as before,
   a ksiginfo can carry more information, for example, allow signal to
   be delivered but throw away siginfo data if memory is not enough.
   SIGKILL and SIGSTOP have fast path in sigqueue_add, because they can
   not be caught or masked.
   The sigqueue() syscall allows user code to queue a signal to target
   process, if resource is unavailable, EAGAIN will be returned as
   specification said.
   Just before thread exits, signal queue memory will be freed by
   sigqueue_flush.
   Current, all signals are allowed to be queued, not only realtime signals.

Earlier patch reviewed by: jhb, deischen
Tested on: i386, amd64
44 files changed:
sys/alpha/alpha/machdep.c
sys/alpha/alpha/trap.c
sys/alpha/linux/linux_sysvec.c
sys/alpha/osf1/osf1_signal.c
sys/alpha/osf1/osf1_signal.h
sys/amd64/amd64/machdep.c
sys/amd64/amd64/trap.c
sys/amd64/ia32/ia32_signal.c
sys/amd64/ia32/ia32_syscall.c
sys/amd64/linux32/linux32_sysvec.c
sys/arm/arm/machdep.c
sys/arm/arm/trap.c
sys/arm/arm/undefined.c
sys/compat/ia32/ia32_signal.h
sys/compat/linux/linux_misc.c
sys/compat/svr4/svr4_signal.h
sys/fs/procfs/procfs_ctl.c
sys/i386/i386/machdep.c
sys/i386/i386/trap.c
sys/i386/linux/linux_sysvec.c
sys/i386/svr4/svr4_machdep.c
sys/ia64/ia32/ia32_signal.c
sys/ia64/ia32/ia32_trap.c
sys/ia64/ia64/machdep.c
sys/ia64/ia64/trap.c
sys/kern/init_sysent.c
sys/kern/kern_exec.c
sys/kern/kern_exit.c
sys/kern/kern_kse.c
sys/kern/kern_sig.c
sys/kern/kern_thr.c
sys/kern/kern_thread.c
sys/kern/subr_trap.c
sys/kern/syscalls.master
sys/pc98/pc98/machdep.c
sys/powerpc/aim/machdep.c
sys/powerpc/aim/trap.c
sys/powerpc/powerpc/machdep.c
sys/powerpc/powerpc/trap.c
sys/sparc64/sparc64/machdep.c
sys/sparc64/sparc64/trap.c
sys/sys/proc.h
sys/sys/signalvar.h
sys/sys/sysent.h