version 1.12.8.3, 2008/11/20 20:45:39 |
version 1.12.8.4, 2008/12/27 23:14:24 |
Line 328 sigaction1(struct lwp *l, int signum, co |
|
Line 328 sigaction1(struct lwp *l, int signum, co |
|
sigset_t tset; |
sigset_t tset; |
int prop, error; |
int prop, error; |
ksiginfoq_t kq; |
ksiginfoq_t kq; |
|
static bool v0v1valid; |
|
|
if (signum <= 0 || signum >= NSIG) |
if (signum <= 0 || signum >= NSIG) |
return (EINVAL); |
return (EINVAL); |
Line 349 sigaction1(struct lwp *l, int signum, co |
|
Line 350 sigaction1(struct lwp *l, int signum, co |
|
* using module_lock. If the autoload fails, we don't try it |
* using module_lock. If the autoload fails, we don't try it |
* again for this process. |
* again for this process. |
*/ |
*/ |
#ifdef MODULAR |
if (nsa != NULL) { |
if (__predict_false(vers < 2) && (p->p_lflag & PL_SIGCOMPAT) == 0) { |
if (__predict_false(vers < 2) && |
mutex_enter(&module_lock); |
(p->p_lflag & PL_SIGCOMPAT) == 0) { |
if (sendsig_sigcontext_vec == NULL) { |
mutex_enter(&module_lock); |
(void)module_autoload("compat", MODULE_CLASS_ANY); |
if (sendsig_sigcontext_vec == NULL) { |
|
(void)module_autoload("compat", |
|
MODULE_CLASS_ANY); |
|
} |
|
if (sendsig_sigcontext_vec != NULL) { |
|
/* |
|
* We need to remember if the |
|
* sigcontext method may be useable, |
|
* because libc may use it even |
|
* if siginfo is available. |
|
*/ |
|
v0v1valid = true; |
|
} |
|
mutex_enter(proc_lock); |
|
/* |
|
* Prevent unload of compat module while |
|
* this process remains. |
|
*/ |
|
p->p_lflag |= PL_SIGCOMPAT; |
|
mutex_exit(proc_lock); |
|
mutex_exit(&module_lock); |
} |
} |
mutex_enter(proc_lock); |
|
p->p_lflag |= PL_SIGCOMPAT; |
|
mutex_exit(proc_lock); |
|
mutex_exit(&module_lock); |
|
} |
|
#endif /* MODULAR */ |
|
|
|
if (vers == 0 && (tramp != NULL || p->p_emul->e_sigcode == NULL)) { |
switch (vers) { |
return EINVAL; |
case 0: |
} |
/* sigcontext, kernel supplied trampoline. */ |
if (vers != 0 && (tramp == NULL || vers > 2)) { |
if (tramp != NULL || !v0v1valid) { |
return EINVAL; |
return EINVAL; |
|
} |
|
break; |
|
case 1: |
|
/* sigcontext, user supplied trampoline. */ |
|
if (tramp == NULL || !v0v1valid) { |
|
return EINVAL; |
|
} |
|
break; |
|
case 2: |
|
case 3: |
|
/* siginfo, user supplied trampoline. */ |
|
if (tramp == NULL) { |
|
return EINVAL; |
|
} |
|
break; |
|
default: |
|
return EINVAL; |
|
} |
} |
} |
|
|
mutex_enter(p->p_lock); |
mutex_enter(p->p_lock); |