Commit Graph

43 Commits

Author SHA1 Message Date
martin
5f7e4ad45b Make kill1 public (we'll need it from compat/netbsd32) 2015-06-19 10:18:19 +00:00
snj
f0a7346d21 src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
2014-10-18 08:33:23 +00:00
christos
b9e9a610e4 Don't check trampolines for SIG_DFL or SIG_IGN since they are not used.
From gimpy.
2014-02-14 16:35:11 +00:00
apb
f92c0e46b0 Properly differentiate between infinite timeout and zero timeout.
Local variable timo = -1 is used for zero timeout (non blocking mode).

Fixes PR 47625 from anthony.mallet
2013-03-08 09:32:59 +00:00
apb
7c5d63e1c6 In the timeout passed to sigtimedwait, NULL means an infinite timeout,
and {.tv_sec = 0, .tv_nsec=0} means do not block at all.  Add a comment
saying so.  The code incorrectly treats them both as an infinite timeout,
and that is not fixed by this commit.
2013-03-08 08:48:38 +00:00
christos
131cc4df10 It is useless to check for sigcontext_vec and compat module loading for
PK_32 processes. The correct modules are already loaded, otherwise how
is the process running?
2013-01-22 01:45:59 +00:00
christos
c296146af8 From Roger Pau Monne: kill(2) called for a zombie process should return 0,
according to:
    http://pubs.opengroup.org/onlinepubs/9699919799/functions/kill.html
2012-07-18 20:30:07 +00:00
rmind
ad12c77015 Remove COMPAT_SA / KERN_SA. Welcome to 6.99.3!
Approved by core@.
2012-02-19 21:05:51 +00:00
christos
d8bca0f24f add a copyin function for sigset so that we can use sigtimedwait1 from
emulations.
2011-11-18 03:34:13 +00:00
christos
41ceba0065 when undoing the sigsuspend setup, either take the signal and allow the
signal path to restore the mask, or restore the mask here.
2011-05-29 22:14:53 +00:00
christos
0b60c7be7c If a signal did not fire, restore the original signal mask for pselect/pollts
using a signal mask. Tested by tron.
2011-05-28 15:33:40 +00:00
christos
e2543d0362 PR/43625: Mark Davies: Fix pselect(2) to honor the temporary mask. pselect(2)
(and pollts(2)) are similar to sigsuspend(2) in that they temporarily change
the process signal mask and wait for signal delivery. Factor out and share the
code that does this.
2011-05-18 03:51:41 +00:00
martin
ccc5092ed2 Do not restrict the siginfo a process sends to itself in any way, but
keep restrictions for foreign processes. This is needed to allow raising
of full SIGFPE siginfo from softfloat libraries for example.
2011-03-03 20:46:16 +00:00
joerg
13011308e4 Explicitly initialize ucontext before calling getmcontext. 2011-02-03 21:45:31 +00:00
christos
3d70c4b47c implement sigqueueinfo 2011-01-10 04:39:18 +00:00
pgoyette
23d5409e7e Update the rest of the kernel to conform to the module subsystem's new
locking protocol.
2010-08-21 13:19:39 +00:00
rmind
3c507045e2 Remove pfind() and pgfind(), fix locking in various broken uses of these.
Rename real routines to proc_find() and pgrp_find(), remove PFIND_* flags
and have consistent behaviour.  Provide proc_find_raw() for special cases.
Fix memory leak in sysctl_proc_corename().

COMPAT_LINUX: rework ptrace() locking, minimise differences between
different versions per-arch.

Note: while this change adds some formal cosmetics for COMPAT_DARWIN and
COMPAT_IRIX - locking there is utterly broken (for ages).

Fixes PR/43176.
2010-07-01 02:38:26 +00:00
drochner
8239dc73b5 fix sigwaitinfo/sigtimedwait:
-allow NULL "info" pointer
-return signal number
2010-05-20 17:10:42 +00:00
pooka
654415b2b7 Get rid of last "easy" kernel symbols starting with __:
__assert -> kern_assert
__sigtimedwait1 -> sigtimedwait1
__wdstart -> wdstart1

The rest are MD and/or shared with userspace, so they will require
a little more involvement than what is available for this quick
"ride the 5.99.24 bump" action.
2010-01-19 22:28:30 +00:00
rmind
3c74cdf150 signal(9) code: add some comments, improve/fix wrong ones. While here, kill
trailing whitespaces, wrap long lines, etc.  No functional changes intended.
2009-12-20 04:49:09 +00:00
rmind
ebd0ab14ab sigtimedwait: fix a memory leak (which happens since newlock2 times).
Allocate ksiginfo on stack since it is safe and sigget() assumes that it is
not allocated from pool (pending signals via sigput()/sigget() "mill" should
be dynamically allocated, however).  Might be useful to revisit later.

Likely the cause of PR/40750 and indirect cause of PR/39283.
2009-12-19 18:25:54 +00:00
christos
6e1db6cea1 - use itimespecfix to detect invalid timespecs
- use tstohz instead of mstohz to prevent overflow.
2009-03-29 17:54:12 +00:00
christos
94f59b4d43 PR/41094: Matteo Beccati: sigtimedwait returns EAGAIN instead of EINVAL if
timeout is invalid
2009-03-29 16:23:23 +00:00
christos
461a86f9bd merge christos-time_t 2009-01-11 02:45:45 +00:00
ad
9d09ecfa96 sigaction1: we need to remember if the sigcontext method may be useable,
because libc can use it even if siginfo is available.

Changes are needed in libc to stop this being a performance penalty but
they will come later.
2008-11-25 16:42:44 +00:00
ad
92ce8c6a3d Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime
2008-11-19 18:35:57 +00:00
ad
57de28fac5 - Move some more compat code into sys/compat.
- Split 4.3BSD ifioctl stuff into its own file.
- Remove some ifdefs that include small fragments of vfs compat code
  which are difficult to relocate elsewhere.
2008-11-14 23:10:57 +00:00
wrstuden
fc7511b00e Merge wrstuden-revivesa into HEAD. 2008-10-15 06:51:17 +00:00
ad
d23ae8da8d sigpending1: don't subtract the sigmask (!!). 2008-06-25 11:04:24 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
ad
284c2b9aef Merge proc::p_mutex and proc::p_smutex into a single adaptive mutex, since
we no longer need to guard against access from hardware interrupt handlers.

Additionally, if cloning a process with CLONE_SIGHAND, arrange to have the
child process share the parent's lock so that signal state may be kept in
sync. Partially addresses PR kern/37437.
2008-04-24 18:39:20 +00:00
ad
6d70f903e6 Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
  be sent from a hardware interrupt handler. Signal activity must be
  deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
  and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.
2008-04-24 15:35:27 +00:00
yamt
70e552c2cb sigpause -> sigsuspend in comments. 2008-02-19 12:20:02 +00:00
elad
142877c301 Forgot to commit these two as well. Spotted by hannken@.
Adapt to "CAN" removal.
2008-01-23 17:56:53 +00:00
ad
4a780c9ae2 Merge vmlocking2 to head. 2008-01-02 11:48:20 +00:00
dsl
7e2790cf6f Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
    int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
2007-12-20 23:02:38 +00:00
ad
88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
ad
c147748d84 - Make the proclist_lock a mutex. The write:read ratio is unfavourable,
and mutexes are cheaper use than RW locks.
- LOCK_ASSERT -> KASSERT in some places.
- Hold proclist_lock/kernel_lock longer in a couple of places.
2007-03-09 14:11:22 +00:00
ad
a76d1d298c Further avoid unnecessary trips through lwp_userret()/issignal(). 2007-02-27 15:19:54 +00:00
thorpej
4f3d5a9cc0 TRUE -> true, FALSE -> false 2007-02-22 06:34:42 +00:00
pavel
934634a18c Change the process/lwp flags seen by userland via sysctl back to the
P_*/L_* naming convention, and rename the in-kernel flags to avoid
conflict. (P_ -> PK_, L_ -> LW_ ). Add back the (now unused) LSDEAD
constant.

Restores source compatibility with pre-newlock2 tools like ps or top.

Reviewed by Andrew Doran.
2007-02-17 22:31:36 +00:00
ad
b6ab00c330 A quick hack to get things building again: put back the SA system calls
with no arguments, and alias them to sys_nosys. To be revisited.
2007-02-10 11:32:21 +00:00
ad
b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00