本文整理汇总了C++中send_sig_info函数的典型用法代码示例。如果您正苦于以下问题:C++ send_sig_info函数的具体用法?C++ send_sig_info怎么用?C++ send_sig_info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了send_sig_info函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: vfp_raise_sigfpe
/*
* Raise a SIGFPE for the current process.
* sicode describes the signal being raised.
*/
static void vfp_raise_sigfpe(unsigned int sicode, struct pt_regs *regs)
{
siginfo_t info;
memset(&info, 0, sizeof(info));
info.si_signo = SIGFPE;
info.si_code = sicode;
info.si_addr = (void __user *)(instruction_pointer(regs) - 4);
/*
* This is the same as NWFPE, because it's not clear what
* this is used for
*/
current->thread.error_code = 0;
current->thread.trap_no = 6;
send_sig_info(SIGFPE, &info, current);
}
示例2: ucf64_raise_sigfpe
void ucf64_raise_sigfpe(unsigned int sicode, struct pt_regs *regs)
{
siginfo_t info;
memset(&info, 0, sizeof(info));
info.si_signo = SIGFPE;
info.si_code = sicode;
info.si_addr = (void __user *)(instruction_pointer(regs) - 4);
/*
*/
current->thread.error_code = 0;
current->thread.trap_no = 6;
send_sig_info(SIGFPE, &info, current);
}
示例3: send_sigio
static void send_sigio(struct fown_struct *fown, struct fasync_struct *fa)
{
struct task_struct * p;
int pid = fown->pid;
uid_t uid = fown->uid;
uid_t euid = fown->euid;
read_lock(&tasklist_lock);
for_each_task(p) {
int match = p->pid;
if (pid < 0)
match = -p->pgrp;
if (pid != match)
continue;
if ((euid != 0) &&
(euid ^ p->suid) && (euid ^ p->uid) &&
(uid ^ p->suid) && (uid ^ p->uid))
continue;
switch (fown->signum) {
siginfo_t si;
default:
/* Queue a rt signal with the appropriate fd as its
value. We use SI_SIGIO as the source, not
SI_KERNEL, since kernel signals always get
delivered even if we can't queue. Failure to
queue in this case _should_ be reported; we fall
back to SIGIO in that case. --sct */
si.si_signo = fown->signum;
si.si_errno = 0;
si.si_code = SI_SIGIO;
si.si_pid = pid;
si.si_uid = uid;
si.si_fd = fa->fa_fd;
if (!send_sig_info(fown->signum, &si, p))
break;
/* fall-through: fall back on the old plain SIGIO signal */
case 0:
send_sig(SIGIO, p, 1);
}
}
read_unlock(&tasklist_lock);
}
示例4: diag_notify_md_client
void diag_notify_md_client(uint8_t peripheral, int data)
{
int stat = 0;
struct siginfo info;
if (driver->logging_mode != MEMORY_DEVICE_MODE)
return;
memset(&info, 0, sizeof(struct siginfo));
info.si_code = SI_QUEUE;
info.si_int = (PERIPHERAL_MASK(peripheral) | data);
info.si_signo = SIGCONT;
if (driver->md_proc[DIAG_LOCAL_PROC].mdlog_process) {
stat = send_sig_info(info.si_signo, &info,
driver->md_proc[DIAG_LOCAL_PROC].mdlog_process);
if (stat)
pr_err("diag: Err sending signal to memory device client, signal data: 0x%x, stat: %d\n",
info.si_int, stat);
}
}
示例5: vperfctr_handle_overflow
static void vperfctr_handle_overflow(struct task_struct *tsk,
struct vperfctr *perfctr)
{
unsigned int pmc_mask;
siginfo_t si;
sigset_t old_blocked;
pmc_mask = perfctr_cpu_identify_overflow(&perfctr->cpu_state);
if (!pmc_mask) {
printk(KERN_ERR "%s: BUG! pid %d has unidentifiable overflow source\n",
__FUNCTION__, tsk->pid);
return;
}
/* suspend a-mode and i-mode PMCs, leaving only TSC on */
/* XXX: some people also want to suspend the TSC */
perfctr->iresume_cstatus = perfctr->cpu_state.cstatus;
if (perfctr_cstatus_has_tsc(perfctr->iresume_cstatus)) {
perfctr->cpu_state.cstatus = perfctr_mk_cstatus(1, 0, 0);
vperfctr_resume(perfctr);
} else
perfctr->cpu_state.cstatus = 0;
si.si_signo = perfctr->si_signo;
si.si_errno = 0;
si.si_code = SI_PMC_OVF;
si.si_pmc_ovf_mask = pmc_mask;
/* deliver signal without waking up the receiver */
spin_lock_irq(&task_siglock(tsk));
old_blocked = tsk->blocked;
sigaddset(&tsk->blocked, si.si_signo);
spin_unlock_irq(&task_siglock(tsk));
if (!send_sig_info(si.si_signo, &si, tsk))
send_sig(si.si_signo, tsk, 1);
spin_lock_irq(&task_siglock(tsk));
tsk->blocked = old_blocked;
recalc_sigpending();
spin_unlock_irq(&task_siglock(tsk));
}
示例6: sys_use_signal
asmlinkage long sys_use_signal(int pid) {
struct task_struct* task;
task = find_task_by_vpid(pid);
/*** make a signal ***/
struct siginfo info;
memset(&info, 0, sizeof(struct siginfo));
info.si_signo = SIGUSR1;
info.si_code = SI_KERNEL;
/*** send the signal to current process ***/
int ret = send_sig_info(SIGUSR1, &info, task);
if(ret < 0) {
printk(KERN_WARNING "send_sig_info: error sending signal (ret: %d)\n", ret);
}
else {
printk(KERN_DEBUG "send signal to pid: %d\n", task->pid);
}
return 0;
}
示例7: do_illegal_instruction
void do_illegal_instruction(struct pt_regs *regs, unsigned long pc, unsigned long npc,
unsigned long psr)
{
extern int do_user_muldiv (struct pt_regs *, unsigned long);
siginfo_t info;
if(psr & PSR_PS)
die_if_kernel("Kernel illegal instruction", regs);
#ifdef TRAP_DEBUG
printk("Ill instr. at pc=%08lx instruction is %08lx\n",
regs->pc, *(unsigned long *)regs->pc);
#endif
if (!do_user_muldiv (regs, pc))
return;
info.si_signo = SIGILL;
info.si_errno = 0;
info.si_code = ILL_ILLOPC;
info.si_addr = (void *)pc;
info.si_trapno = 0;
send_sig_info(SIGILL, &info, current);
}
示例8: sunos_nosys
asmlinkage int sunos_nosys(void)
{
struct pt_regs *regs;
siginfo_t info;
static int cnt;
lock_kernel();
regs = current->thread.kregs;
info.si_signo = SIGSYS;
info.si_errno = 0;
info.si_code = __SI_FAULT|0x100;
info.si_addr = (void *)regs->pc;
info.si_trapno = regs->u_regs[UREG_G1];
send_sig_info(SIGSYS, &info, current);
if (cnt++ < 4) {
printk("Process makes ni_syscall number %d, register dump:\n",
(int) regs->u_regs[UREG_G1]);
show_regs(regs);
}
unlock_kernel();
return -ENOSYS;
}
示例9: aa_audit
/**
* aa_audit - Log a profile based audit event to the audit subsystem
* @type: audit type for the message
* @profile: profile to check against (NOT NULL)
* @gfp: allocation flags to use
* @sa: audit event (NOT NULL)
* @cb: optional callback fn for type specific fields (MAYBE NULL)
*
* Handle default message switching based off of audit mode flags
*
* Returns: error on failure
*/
int aa_audit(int type, struct aa_profile *profile, gfp_t gfp,
struct common_audit_data *sa,
void (*cb) (struct audit_buffer *, void *))
{
BUG_ON(!profile);
if (type == AUDIT_APPARMOR_AUTO) {
if (likely(!sa->aad->error)) {
if (AUDIT_MODE(profile) != AUDIT_ALL)
return 0;
type = AUDIT_APPARMOR_AUDIT;
} else if (COMPLAIN_MODE(profile))
type = AUDIT_APPARMOR_ALLOWED;
else
type = AUDIT_APPARMOR_DENIED;
}
if (AUDIT_MODE(profile) == AUDIT_QUIET ||
(type == AUDIT_APPARMOR_DENIED &&
AUDIT_MODE(profile) == AUDIT_QUIET))
return sa->aad->error;
if (KILL_MODE(profile) && type == AUDIT_APPARMOR_DENIED)
type = AUDIT_APPARMOR_KILL;
if (!unconfined(profile))
sa->aad->profile = profile;
aa_audit_msg(type, sa, cb);
if (sa->aad->type == AUDIT_APPARMOR_KILL)
(void)send_sig_info(SIGKILL, NULL,
sa->u.tsk ? sa->u.tsk : current);
if (sa->aad->type == AUDIT_APPARMOR_ALLOWED)
return complain_error(sa->aad->error);
return sa->aad->error;
}
示例10: do_fpsimd_exc
/*
* Raise a SIGFPE for the current process.
*/
void do_fpsimd_exc(unsigned int esr, struct pt_regs *regs)
{
siginfo_t info;
unsigned int si_code = 0;
if (esr & FPEXC_IOF)
si_code = FPE_FLTINV;
else if (esr & FPEXC_DZF)
si_code = FPE_FLTDIV;
else if (esr & FPEXC_OFF)
si_code = FPE_FLTOVF;
else if (esr & FPEXC_UFF)
si_code = FPE_FLTUND;
else if (esr & FPEXC_IXF)
si_code = FPE_FLTRES;
memset(&info, 0, sizeof(info));
info.si_signo = SIGFPE;
info.si_code = si_code;
info.si_addr = (void __user *)instruction_pointer(regs);
send_sig_info(SIGFPE, &info, current);
}
示例11: do_memaccess_unaligned
void do_memaccess_unaligned(struct pt_regs *regs, unsigned long pc, unsigned long npc,
unsigned long psr)
{
siginfo_t info;
if(regs->psr & PSR_PS) {
printk("KERNEL MNA at pc %08lx npc %08lx called by %08lx\n", pc, npc,
regs->u_regs[UREG_RETPC]);
die_if_kernel("BOGUS", regs);
/* die_if_kernel("Kernel MNA access", regs); */
}
#if 0
show_regs (regs);
instruction_dump ((unsigned long *) regs->pc);
printk ("do_MNA!\n");
#endif
info.si_signo = SIGBUS;
info.si_errno = 0;
info.si_code = BUS_ADRALN;
info.si_addr = /* FIXME: Should dig out mna address */ (void *)0;
info.si_trapno = 0;
send_sig_info(SIGBUS, &info, current);
}
示例12: hostirq_handler
irqreturn_t hostirq_handler(int irq, void *pkv)
{
siginfo_t si;
kernel_vars_t *kv = (kernel_vars_t *) pkv;
/* disable the irq */
disable_irq_nosync(irq);
/* have the interrupt handled */
if (!test_and_set_bit(irq, kv->mregs.active_irqs.irqs))
atomic_inc((atomic_t *) &
(kv->mregs.hostirq_active_cnt));
kv->mregs.hostirq_update = 1;
kv->mregs.interrupt = 1;
/* signal the main thread (it might be DOZEing) */
if (kv->main_thread != NULL) {
memset(&si, 0, sizeof(si));
si.si_signo = SIGHUP;
si.si_code = irq;
send_sig_info(SIGHUP, &si, kv->main_thread);
}
return IRQ_HANDLED;
}
示例13: do_entArith
asmlinkage void
do_entArith(unsigned long summary, unsigned long write_mask,
struct pt_regs *regs)
{
long si_code = FPE_FLTINV;
siginfo_t info;
if (summary & 1) {
if (!amask(AMASK_PRECISE_TRAP))
si_code = alpha_fp_emul(regs->pc - 4);
else
si_code = alpha_fp_emul_imprecise(regs, write_mask);
if (si_code == 0)
return;
}
die_if_kernel("Arithmetic fault", regs, 0, NULL);
info.si_signo = SIGFPE;
info.si_errno = 0;
info.si_code = si_code;
info.si_addr = (void __user *) regs->pc;
send_sig_info(SIGFPE, &info, current);
}
示例14: aa_audit
/**
* aa_audit - Log a profile based audit event to the audit subsystem
* @type: audit type for the message
* @profile: profile to check against (NOT NULL)
* @sa: audit event (NOT NULL)
* @cb: optional callback fn for type specific fields (MAYBE NULL)
*
* Handle default message switching based off of audit mode flags
*
* Returns: error on failure
*/
int aa_audit(int type, struct aa_profile *profile, struct common_audit_data *sa,
void (*cb) (struct audit_buffer *, void *))
{
BUG_ON(!profile);
if (type == AUDIT_APPARMOR_AUTO) {
if (likely(!aad(sa)->error)) {
if (AUDIT_MODE(profile) != AUDIT_ALL)
return 0;
type = AUDIT_APPARMOR_AUDIT;
} else if (COMPLAIN_MODE(profile))
type = AUDIT_APPARMOR_ALLOWED;
else
type = AUDIT_APPARMOR_DENIED;
}
if (AUDIT_MODE(profile) == AUDIT_QUIET ||
(type == AUDIT_APPARMOR_DENIED &&
AUDIT_MODE(profile) == AUDIT_QUIET))
return aad(sa)->error;
if (KILL_MODE(profile) && type == AUDIT_APPARMOR_DENIED)
type = AUDIT_APPARMOR_KILL;
aad(sa)->label = &profile->label;
aa_audit_msg(type, sa, cb);
if (aad(sa)->type == AUDIT_APPARMOR_KILL)
(void)send_sig_info(SIGKILL, NULL,
sa->type == LSM_AUDIT_DATA_TASK && sa->u.tsk ?
sa->u.tsk : current);
if (aad(sa)->type == AUDIT_APPARMOR_ALLOWED)
return complain_error(aad(sa)->error);
return aad(sa)->error;
}
示例15: do_rt_sigreturn
asmlinkage void
do_rt_sigreturn(struct rt_sigframe __user *frame, struct pt_regs *regs,
struct switch_stack *sw)
{
sigset_t set;
/* Verify that it's a good ucontext_t before using it */
if (verify_area(VERIFY_READ, &frame->uc, sizeof(frame->uc)))
goto give_sigsegv;
if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
goto give_sigsegv;
sigdelsetmask(&set, ~_BLOCKABLE);
spin_lock_irq(¤t->sighand->siglock);
current->blocked = set;
recalc_sigpending();
spin_unlock_irq(¤t->sighand->siglock);
if (restore_sigcontext(&frame->uc.uc_mcontext, regs, sw))
goto give_sigsegv;
/* Send SIGTRAP if we're single-stepping: */
if (ptrace_cancel_bpt (current)) {
siginfo_t info;
info.si_signo = SIGTRAP;
info.si_errno = 0;
info.si_code = TRAP_BRKPT;
info.si_addr = (void __user *) regs->pc;
info.si_trapno = 0;
send_sig_info(SIGTRAP, &info, current);
}
return;
give_sigsegv:
force_sig(SIGSEGV, current);
}