• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ sigdelsetmask函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中sigdelsetmask函数的典型用法代码示例。如果您正苦于以下问题:C++ sigdelsetmask函数的具体用法?C++ sigdelsetmask怎么用?C++ sigdelsetmask使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了sigdelsetmask函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: sys_rt_sigreturn

asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5,
				unsigned long r6, unsigned long r7,
				struct pt_regs __regs)
{
	struct pt_regs *regs = RELOC_HIDE(&__regs, 0);
	struct rt_sigframe __user *frame = (struct rt_sigframe __user *)regs->regs[15];
	sigset_t set;
	stack_t st;
	int r0;

	if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
		goto badframe;

	if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
		goto badframe;

	sigdelsetmask(&set, ~_BLOCKABLE);
	spin_lock_irq(&current->sighand->siglock);
	current->blocked = set;
	recalc_sigpending();
	spin_unlock_irq(&current->sighand->siglock);

	if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &r0))
		goto badframe;

	if (__copy_from_user(&st, &frame->uc.uc_stack, sizeof(st)))
		goto badframe;
	/* It is more difficult to avoid calling this function than to
	   call it and ignore errors.  */
	do_sigaltstack((const stack_t __user *)&st, NULL, (unsigned long)frame);

	return r0;

badframe:
	force_sig(SIGSEGV, current);
	return 0;
}
开发者ID:cilynx,项目名称:dd-wrt,代码行数:37,代码来源:signal.c


示例2: do_sigreturn

asmlinkage void
do_sigreturn(struct sigcontext __user *sc, struct pt_regs *regs,
	     struct switch_stack *sw)
{
	sigset_t set;

	/* Verify that it's a good sigcontext before using it */
	if (verify_area(VERIFY_READ, sc, sizeof(*sc)))
		goto give_sigsegv;
	if (__get_user(set.sig[0], &sc->sc_mask))
		goto give_sigsegv;

	sigdelsetmask(&set, ~_BLOCKABLE);
	spin_lock_irq(&current->sighand->siglock);
	current->blocked = set;
	recalc_sigpending();
	spin_unlock_irq(&current->sighand->siglock);

	if (restore_sigcontext(sc, 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);
}
开发者ID:BackupTheBerlios,项目名称:tuxap,代码行数:37,代码来源:signal.c


示例3: _sys_rt_sigreturn

asmlinkage long _sys_rt_sigreturn(struct pt_regs *regs)
{
	struct rt_sigframe *frame = (struct rt_sigframe __user *)regs->sp;
	sigset_t set;
	stack_t st;

	/*
                                                    
                                                     
                                                 
  */
	if (((long)frame) & 3)
		goto badframe;

	if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
		goto badframe;
	if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
		goto badframe;

	sigdelsetmask(&set, ~_BLOCKABLE);
	set_current_blocked(&set);

	if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
		goto badframe;

	if (__copy_from_user(&st, &frame->uc.uc_stack, sizeof(st)))
		goto badframe;
	/*                                                            
                                */
	do_sigaltstack(&st, NULL, regs->sp);

	return regs->gpr[11];

badframe:
	force_sig(SIGSEGV, current);
	return 0;
}
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:37,代码来源:signal.c


示例4: sys_sigreturn

asmlinkage void sys_sigreturn(nabi_no_regargs struct pt_regs regs)
{
	struct sigframe __user *frame;
	sigset_t blocked;
	int sig;

	frame = (struct sigframe __user *) regs.regs[29];
	if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
		goto badframe;
	if (__copy_from_user(&blocked, &frame->sf_mask, sizeof(blocked)))
		goto badframe;

	sigdelsetmask(&blocked, ~_BLOCKABLE);
	spin_lock_irq(&current->sighand->siglock);
	current->blocked = blocked;
	recalc_sigpending();
	spin_unlock_irq(&current->sighand->siglock);

	sig = restore_sigcontext(&regs, &frame->sf_sc);
	if (sig < 0)
		goto badframe;
	else if (sig)
		force_sig(sig, current);

	/*
	 * Don't let your children do this ...
	 */
	__asm__ __volatile__(
		"move\t$29, %0\n\t"
		"j\tsyscall_exit"
		:/* no outputs */
		:"r" (&regs));
	/* Unreached */

badframe:
	force_sig(SIGSEGV, current);
}
开发者ID:lishaman,项目名称:minispeaker,代码行数:37,代码来源:signal.c


示例5: 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 (!access_ok(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(&current->sighand->siglock);
	current->blocked = set;
	recalc_sigpending();
	spin_unlock_irq(&current->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);
}
开发者ID:007Maximus007,项目名称:htc_kernel_desirec_cfs,代码行数:37,代码来源:signal.c


示例6: sys_rt_sigreturn

asmlinkage int sys_rt_sigreturn(long r10, long r11, long r12, long r13,
                                long mof, long srp, struct pt_regs *regs)
{
	struct rt_sigframe __user *frame = (struct rt_sigframe *)rdusp();
	sigset_t set;

        /*
         * Since we stacked the signal on a dword boundary,
         * then frame should be dword aligned here.  If it's
         * not, then the user is trying to mess with us.
         */
        if (((long)frame) & 3)
                goto badframe;

	if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
		goto badframe;
	if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
		goto badframe;

	sigdelsetmask(&set, ~_BLOCKABLE);
	spin_lock_irq(&current->sighand->siglock);
	current->blocked = set;
	recalc_sigpending();
	spin_unlock_irq(&current->sighand->siglock);

	if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
		goto badframe;

	if (do_sigaltstack(&frame->uc.uc_stack, NULL, rdusp()) == -EFAULT)
		goto badframe;

	return regs->r10;

badframe:
	force_sig(SIGSEGV, current);
	return 0;
}
开发者ID:0x0f,项目名称:adam-kernel,代码行数:37,代码来源:signal.c


示例7: sys_rt_sigreturn

asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5,
				unsigned long r6, unsigned long r7,
				struct pt_regs __regs)
{
	struct pt_regs *regs = RELOC_HIDE(&__regs, 0);
	struct rt_sigframe __user *frame = (struct rt_sigframe __user *)regs->regs[15];
	sigset_t set;
	int r0;

	/* Always make any pending restarted system calls return -EINTR */
	current_thread_info()->restart_block.fn = do_no_restart_syscall;

	if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
		goto badframe;

	if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
		goto badframe;

	sigdelsetmask(&set, ~_BLOCKABLE);
	spin_lock_irq(&current->sighand->siglock);
	current->blocked = set;
	recalc_sigpending();
	spin_unlock_irq(&current->sighand->siglock);

	if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &r0))
		goto badframe;

	if (do_sigaltstack(&frame->uc.uc_stack, NULL,
			   regs->regs[15]) == -EFAULT)
		goto badframe;

	return r0;

badframe:
	force_sig(SIGSEGV, current);
	return 0;
}
开发者ID:PeterDaveHello,项目名称:kernel-pdk7105,代码行数:37,代码来源:signal_32.c


示例8: sys32_sigreturn

void sys32_sigreturn(struct pt_regs *regs)
{
	struct sigframe *frame;
	sigset_t blocked;

	frame = (struct sigframe *) MIPS_sp(regs);
	if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
		goto badframe;
	if (__copy_from_user(&blocked, &frame->sf_mask, sizeof(blocked)))
		goto badframe;

	sigdelsetmask(&blocked, ~_BLOCKABLE);
	spin_lock_irq(&current->sighand->siglock);
	current->blocked = blocked;
	recalc_sigpending();
	spin_unlock_irq(&current->sighand->siglock);

	if (restore_sigcontext32(regs, &frame->sf_sc))
		goto badframe;

	/*
	 * Don't let your children do this ...
	 */
	BUG();
//XXX	if (current_thread_info()->flags & TIF_SYSCALL_TRACE)
//		do_syscall_trace();
//	__asm__ __volatile__(
//		"move\t$29, %0\n\t"
//		"j\tsyscall_exit"
//		:/* no outputs */
//		:"r" (&regs));
	/* Unreached */

badframe:
	force_sig(SIGSEGV, current);
}
开发者ID:CSU-GH,项目名称:okl4_3.0,代码行数:36,代码来源:signal.c


示例9: sys_rt_sigreturn

asmlinkage int
sys_rt_sigreturn(unsigned long r0, unsigned long r1,
		 unsigned long r2, unsigned long r3, unsigned long r4,
		 unsigned long r5, unsigned long r6, struct pt_regs regs)
{
	struct rt_sigframe __user *frame = (struct rt_sigframe __user *)regs.spu;
	sigset_t set;
	stack_t st;
	int result;

	if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
		goto badframe;
	if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
		goto badframe;

	sigdelsetmask(&set, ~_BLOCKABLE);
	spin_lock_irq(&current->sighand->siglock);
	current->blocked = set;
	recalc_sigpending();
	spin_unlock_irq(&current->sighand->siglock);

	if (restore_sigcontext(&regs, &frame->uc.uc_mcontext, &result))
		goto badframe;

	if (__copy_from_user(&st, &frame->uc.uc_stack, sizeof(st)))
		goto badframe;
	/* It is more difficult to avoid calling this function than to
	   call it and ignore errors.  */
	do_sigaltstack(&st, NULL, regs.spu);

	return result;

badframe:
	force_sig(SIGSEGV, current);
	return 0;
}
开发者ID:GodFox,项目名称:magx_kernel_xpixl,代码行数:36,代码来源:signal.c


示例10: sys_rt_sigreturn

asmlinkage int
sys_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
		 unsigned long r6, unsigned long r7, unsigned long r8,
		 struct pt_regs *regs)
{
	struct ucontext *uc = (struct ucontext *)regs->gpr[1];
	sigset_t set;
	stack_t st;

	if (verify_area(VERIFY_READ, uc, sizeof(*uc)))
		goto badframe;

	if (__copy_from_user(&set, &uc->uc_sigmask, sizeof(set)))
		goto badframe;

	sigdelsetmask(&set, ~_BLOCKABLE);
	spin_lock_irq(&current->sigmask_lock);
	current->blocked = set;
	recalc_sigpending(current);
	spin_unlock_irq(&current->sigmask_lock);

	if (restore_sigcontext(regs, NULL, &uc->uc_mcontext))
		goto badframe;

	if (__copy_from_user(&st, &uc->uc_stack, sizeof(st)))
		goto badframe;

	/* This function sets back the stack flags into
	   the current task structure.  */
	sys_sigaltstack(&st, NULL, 0, 0, 0, 0, regs);

	return regs->result;

badframe:
	do_exit(SIGSEGV);
}
开发者ID:SimonKagstrom,项目名称:mci500h-linux-2.4.27,代码行数:36,代码来源:signal.c


示例11: efab_signal_do_sigaction

static int
efab_signal_do_sigaction(int sig, struct sigaction *act,
                         struct sigaction *oact,
                         struct mm_signal_data *tramp_data,
                         int *out_pass_to_kernel)
{
  int rc = 0;

  if( !valid_signal(sig) || sig < 1 || (act != NULL && sig_kernel_only(sig)) )
    return -EINVAL;


  if( oact != NULL ) {
    rc = efab_signal_report_sigaction(sig, oact, tramp_data);
    if( rc != 0 )
      return rc;
  }

  if( act != NULL ) {
    sigdelsetmask(&act->sa_mask, sigmask(SIGKILL) | sigmask(SIGSTOP));

  /* If the signal is ignored now, we should ignore all already-pending
   * signals.  Instead of doing it, pass this to OS. */
    if( act->sa_handler == SIG_IGN ||
        (act->sa_handler == SIG_DFL && sig_kernel_ignore(sig)) )
      *out_pass_to_kernel = 1;
    else if( act->sa_flags & SA_ONSTACK && !tramp_data->sa_onstack_intercept )
      *out_pass_to_kernel = 1;
    else
      rc = efab_signal_substitute(sig, act, tramp_data);
  }
  else
    efab_signal_recheck(sig, tramp_data);

  return rc;
}
开发者ID:davenso,项目名称:openonload,代码行数:36,代码来源:sigaction_calls.c


示例12: do_rt_sigreturn

asmlinkage void
do_rt_sigreturn(struct rt_sigframe *frame, struct pt_regs *regs,
                struct switch_stack *sw)
{
    sigset_t set;
    stack_t st;

    /* Verify that it's a good sigcontext before using it */
    if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
        goto give_sigsegv;
    if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
        goto give_sigsegv;

    sigdelsetmask(&set, ~_BLOCKABLE);
    spin_lock_irq(&current->sigmask_lock);
    current->blocked = set;
    recalc_sigpending(current);
    spin_unlock_irq(&current->sigmask_lock);

    if (restore_sigcontext(&frame->uc.uc_mcontext, regs, sw))
        goto give_sigsegv;

    if (__copy_from_user(&st, &frame->uc.uc_stack, sizeof(st)))
        goto give_sigsegv;
    /* It is more difficult to avoid calling this function than to
       call it and ignore errors.  */
    do_sigaltstack(&st, NULL, rdusp());

    /* Send SIGTRAP if we're single-stepping: */
    if (ptrace_cancel_bpt (current))
        send_sig(SIGTRAP, current, 1);
    return;

give_sigsegv:
    force_sig(SIGSEGV, current);
}
开发者ID:dot-Sean,项目名称:linux_kernels,代码行数:36,代码来源:signal.c


示例13: _sys_sigreturn

__attribute_used__ noinline static void
_sys_sigreturn(nabi_no_regargs struct pt_regs regs)
{
	struct sigframe *frame;
	sigset_t blocked;

	frame = (struct sigframe *) regs.regs[29];
	if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
		goto badframe;
	if (__copy_from_user(&blocked, &frame->sf_mask, sizeof(blocked)))
		goto badframe;

	sigdelsetmask(&blocked, ~_BLOCKABLE);
	spin_lock_irq(&current->sighand->siglock);
	current->blocked = blocked;
	recalc_sigpending();
	spin_unlock_irq(&current->sighand->siglock);

	if (restore_sigcontext(&regs, &frame->sf_sc))
		goto badframe;

	/*
	 * Don't let your children do this ...
	 */
	if (current_thread_info()->flags & TIF_SYSCALL_TRACE)
		do_syscall_trace(&regs, 1);
	__asm__ __volatile__(
		"move\t$29, %0\n\t"
		"j\tsyscall_exit"
		:/* no outputs */
		:"r" (&regs));
	/* Unreached */

badframe:
	force_sig(SIGSEGV, current);
}
开发者ID:kzlin129,项目名称:tt-gpl,代码行数:36,代码来源:signal.c


示例14: sys_rt_sigreturn

asmlinkage long sys_rt_sigreturn(struct pt_regs *regs)
{
	struct rt_sigframe __user *frame;
	sigset_t set;
	unsigned long eax;

	frame = (struct rt_sigframe __user *)(regs->rsp - 8);
	if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) {
		goto badframe;
	} 
	if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) { 
		goto badframe;
	} 

	sigdelsetmask(&set, ~_BLOCKABLE);
	spin_lock_irq(&current->sighand->siglock);
	current->blocked = set;
	recalc_sigpending();
	spin_unlock_irq(&current->sighand->siglock);
	
	if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &eax))
		goto badframe;

#ifdef DEBUG_SIG
	printk("%d sigreturn rip:%lx rsp:%lx frame:%p rax:%lx\n",current->pid,regs.rip,regs.rsp,frame,eax);
#endif

	if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->rsp) == -EFAULT)
		goto badframe;

	return eax;

badframe:
	signal_fault(regs,frame,"sigreturn");
	return 0;
}	
开发者ID:qwerty1023,项目名称:wive-rtnl-firmware,代码行数:36,代码来源:signal.c


示例15: sys_sigreturn

asmlinkage int sys_sigreturn(unsigned long __unused)
{
	struct pt_regs *regs = (struct pt_regs *) &__unused;
	struct sigframe __user *frame = (struct sigframe __user *)(regs->esp - 8);
	sigset_t set;
	int eax;

	if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
		goto badframe;
	if (__get_user(set.sig[0], &frame->sc.oldmask)
	    || (_NSIG_WORDS > 1
		&& __copy_from_user(&set.sig[1], &frame->extramask,
				    sizeof(frame->extramask))))
		goto badframe;

	sigdelsetmask(&set, ~_BLOCKABLE);
	spin_lock_irq(&current->sighand->siglock);
	current->blocked = set;
	recalc_sigpending();
	spin_unlock_irq(&current->sighand->siglock);
	
	if (restore_sigcontext(regs, &frame->sc, &eax))
		goto badframe;
	return eax;

badframe:
	if (show_unhandled_signals && printk_ratelimit())
		printk("%s%s[%d] bad frame in sigreturn frame:%p eip:%lx"
		       " esp:%lx oeax:%lx\n",
		    current->pid > 1 ? KERN_INFO : KERN_EMERG,
		    current->comm, current->pid, frame, regs->eip,
		    regs->esp, regs->orig_eax);

	force_sig(SIGSEGV, current);
	return 0;
}	
开发者ID:D-Land,项目名称:operating-systems,代码行数:36,代码来源:signal.c


示例16: privSocketSend

/*
 * Fairly generic implementation for sending a packet
 * should work for tcp, udp and raw connections.
 */
static unsigned int privSocketSend(void *pPtr,
                                   struct iovec *pVec,
                                   unsigned int uVecLength,
                                   unsigned int uDataLength,
                                   void *pName,
                                   unsigned int uNameLength)
{
  raw_socket *pRaw = (raw_socket *)pPtr;
  unsigned long ulFlags;
  sigset_t sigSet;
  siginfo_t sigInfo;
  struct msghdr mHdr;
  unsigned int uSendLength = uDataLength;
  unsigned int uVecCurrent = 0;
  int iRetries;
  int iError;
  unsigned int rvalue = 0;

  if (NULL != pRaw) {
    /* allow sigkill */
    spin_lock_irqsave(&current->sighand->siglock, ulFlags);
    sigSet = current->blocked;
    sigfillset(&current->blocked);
    sigdelsetmask(&current->blocked, sigmask(SIGKILL));
    recalc_sigpending();
    spin_unlock_irqrestore(&current->sighand->siglock, ulFlags);

    mHdr.msg_control = NULL;
    mHdr.msg_controllen = 0;
    mHdr.msg_flags = MSG_NOSIGNAL | MSG_DONTWAIT;

    /* sockaddr stuff */
    mHdr.msg_name = pName;
    mHdr.msg_namelen = uNameLength;

    while ((true == pRaw->bConnected) && (uSendLength > 0)) {

#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0))
      mHdr.msg_iov = &pVec [uVecCurrent];
      mHdr.msg_iovlen = uVecLength - uVecCurrent;
#endif
      iRetries = 0;
      iError = 0;
      while ((iRetries++ < MAX_RETRIES) && (true == pRaw->bConnected)) {
        /* Finally the kernel does it magic, */
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0))
        iError = sock_sendmsg(pRaw->pSocket,
                              &mHdr,
                              uSendLength);
#else
        iError = kernel_sendmsg(pRaw->pSocket,
				&mHdr,
				(struct kvec *)&pVec [uVecCurrent],
				uVecLength - uVecCurrent,
				uSendLength);
#endif
        if (signal_pending(current)) {
          /* dequeue a sigkill and quiet. */
          spin_lock_irqsave(&current->sighand->siglock, ulFlags);
          dequeue_signal(current, &current->blocked, &sigInfo);
          spin_unlock_irqrestore(&current->sighand->siglock, ulFlags);
          break;
        }

        switch(iError)
          {
          case -EAGAIN:
          case -ENOSPC:
            /* For these errors, les sleep then try again. */
            msleep_interruptible(32 << (iRetries % 4));
            break;
          case 0:
            /* Generic TCP has issues, copied from cifs */
            KLEM_MSG("Recv TCP size issue\n");
            msleep_interruptible(500);
            break;
          default:
            /* must have gotten something more interesting, don't try again */
            iRetries = MAX_RETRIES;
            break;
        }
      }

      /* Did we send any data? consider simplification*/
      if (iError > 0) {
        if (iError >= uSendLength) {
          /* All sent, full write */
          uSendLength -= iError;
          rvalue += iError;
        } else {
          /* fix that partial write */
          while ((uVecCurrent < uVecLength) && (iError > 0)) {
            if (iError >= pVec [uVecCurrent].iov_len) {
              /* We have consumed an entire iov */
              uSendLength -= pVec [uVecCurrent].iov_len;
              iError -= pVec [uVecCurrent].iov_len;
//.........这里部分代码省略.........
开发者ID:stuartwells4,项目名称:klem,代码行数:101,代码来源:klemNet.c


示例17: restore_sigmask

void restore_sigmask(sigset_t *set)
{
	sigdelsetmask(set, ~_BLOCKABLE);
	set_current_blocked(set);
}
开发者ID:Blackburn29,项目名称:PsycoKernel,代码行数:5,代码来源:signal.c


示例18: ckpt_restore_signals

int ckpt_restore_signals(ckpt_desc_t desc)
{
    int i;
    int ret;
    stack_t sigstack;
    sigset_t sigblocked;

    log_restore_signals("restoring sigstack ...");
    if (ckpt_read(desc, &sigstack, sizeof(stack_t)) != sizeof(stack_t)) {
        log_err("failed to get sigstack");
        return -EIO;
    }

    ret = compat_sigaltstack(current, &sigstack, NULL, 0);
    if (ret) {
        log_err("failed to restore sigstack (ret=%d)", ret);
        return ret;
    }

    log_restore_signals("restoring sigblocked ...");
    if (ckpt_read(desc, &sigblocked, sizeof(sigset_t)) != sizeof(sigset_t)) {
        log_err("failed to restore sigstack");
        return -EIO;
    }

    sigdelsetmask(&sigblocked, sigmask(SIGKILL) | sigmask(SIGSTOP));
    spin_lock_irq(&current->sighand->siglock);
    current->blocked = sigblocked;
    recalc_sigpending();
    spin_unlock_irq(&current->sighand->siglock);

    log_restore_signals("restoring pending ...");
    ret = ckpt_restore_sigpending(&current->pending, 0, desc);
    if (ret) {
        log_err("failed to restore pending");
        return ret;
    }

    ret = ckpt_restore_sigpending(&current->signal->shared_pending, 1, desc);
    if (ret) {
        log_err("failed to restore shared_pending");
        return ret;
    }

    log_restore_signals("restoring sigaction ...");
    for (i = 0; i < _NSIG; i++) {
        struct k_sigaction sigaction;

        if (ckpt_read(desc, &sigaction, sizeof(struct k_sigaction)) != sizeof(struct k_sigaction)) {
            log_err("failed to get sigaction");
            return -EIO;
        }

        if ((i != SIGKILL - 1) && (i != SIGSTOP - 1)) {
            ret = do_sigaction(i + 1, &sigaction, 0);
            if (ret) {
                log_err("failed to restore sigaction (ret=%d)", ret);
                return ret;
            }
        }
    }
    log_restore_pos(desc);
    return 0;
}
开发者ID:virthub,项目名称:virthub,代码行数:64,代码来源:restore.c


示例19: do_sigreturn

asmlinkage void do_sigreturn(struct pt_regs *regs)
{
	struct signal_frame __user *sf;
	unsigned long up_psr, pc, npc;
	sigset_t set;
	__siginfo_fpu_t __user *fpu_save;
	__siginfo_rwin_t __user *rwin_save;
	int err;

	/* Always make any pending restarted system calls return -EINTR */
	current_thread_info()->restart_block.fn = do_no_restart_syscall;

	synchronize_user_stack();

	sf = (struct signal_frame __user *) regs->u_regs[UREG_FP];

	/* 1. Make sure we are not getting garbage from the user */
	if (!access_ok(VERIFY_READ, sf, sizeof(*sf)))
		goto segv_and_exit;

	if (((unsigned long) sf) & 3)
		goto segv_and_exit;

	err = __get_user(pc,  &sf->info.si_regs.pc);
	err |= __get_user(npc, &sf->info.si_regs.npc);

	if ((pc | npc) & 3)
		goto segv_and_exit;

	/* 2. Restore the state */
	up_psr = regs->psr;
	err |= __copy_from_user(regs, &sf->info.si_regs, sizeof(struct pt_regs));

	/* User can only change condition codes and FPU enabling in %psr. */
	regs->psr = (up_psr & ~(PSR_ICC | PSR_EF))
		  | (regs->psr & (PSR_ICC | PSR_EF));

	/* Prevent syscall restart.  */
	pt_regs_clear_syscall(regs);

	err |= __get_user(fpu_save, &sf->fpu_save);
	if (fpu_save)
		err |= restore_fpu_state(regs, fpu_save);
	err |= __get_user(rwin_save, &sf->rwin_save);
	if (rwin_save)
		err |= restore_rwin_state(rwin_save);

	/* This is pretty much atomic, no amount locking would prevent
	 * the races which exist anyways.
	 */
	err |= __get_user(set.sig[0], &sf->info.si_mask);
	err |= __copy_from_user(&set.sig[1], &sf->extramask,
			        (_NSIG_WORDS-1) * sizeof(unsigned int));
			   
	if (err)
		goto segv_and_exit;

	sigdelsetmask(&set, ~_BLOCKABLE);
	spin_lock_irq(&current->sighand->siglock);
	current->blocked = set;
	recalc_sigpending();
	spin_unlock_irq(&current->sighand->siglock);
	return;

segv_and_exit:
	force_sig(SIGSEGV, current);
}
开发者ID:119-org,项目名称:hi3518-osdrv,代码行数:67,代码来源:signal_32.c


示例20: do_rt_sigreturn

asmlinkage void do_rt_sigreturn(struct pt_regs *regs)
{
	struct rt_signal_frame __user *sf;
	unsigned int psr, pc, npc;
	__siginfo_fpu_t __user *fpu_save;
	__siginfo_rwin_t __user *rwin_save;
	mm_segment_t old_fs;
	sigset_t set;
	stack_t st;
	int err;

	synchronize_user_stack();
	sf = (struct rt_signal_frame __user *) regs->u_regs[UREG_FP];
	if (!access_ok(VERIFY_READ, sf, sizeof(*sf)) ||
	    (((unsigned long) sf) & 0x03))
		goto segv;

	err = __get_user(pc, &sf->regs.pc);
	err |= __get_user(npc, &sf->regs.npc);
	err |= ((pc | npc) & 0x03);

	err |= __get_user(regs->y, &sf->regs.y);
	err |= __get_user(psr, &sf->regs.psr);

	err |= __copy_from_user(&regs->u_regs[UREG_G1],
				&sf->regs.u_regs[UREG_G1], 15 * sizeof(u32));

	regs->psr = (regs->psr & ~PSR_ICC) | (psr & PSR_ICC);

	/* Prevent syscall restart.  */
	pt_regs_clear_syscall(regs);

	err |= __get_user(fpu_save, &sf->fpu_save);
	if (!err && fpu_save)
		err |= restore_fpu_state(regs, fpu_save);
	err |= __copy_from_user(&set, &sf->mask, sizeof(sigset_t));
	
	err |= __copy_from_user(&st, &sf->stack, sizeof(stack_t));
	
	if (err)
		goto segv;
		
	regs->pc = pc;
	regs->npc = npc;
	
	/* It is more difficult to avoid calling this function than to
	 * call it and ignore errors.
	 */
	old_fs = get_fs();
	set_fs(KERNEL_DS);
	do_sigaltstack((const stack_t __user *) &st, NULL, (unsigned long)sf);
	set_fs(old_fs);

	err |= __get_user(rwin_save, &sf->rwin_save);
	if (!err && rwin_save) {
		if (restore_rwin_state(rwin_save))
			goto segv;
	}

	sigdelsetmask(&set, ~_BLOCKABLE);
	spin_lock_irq(&current->sighand->siglock);
	current->blocked = set;
	recalc_sigpending();
	spin_unlock_irq(&current->sighand->siglock);
	return;
segv:
	force_sig(SIGSEGV, current);
}
开发者ID:119-org,项目名称:hi3518-osdrv,代码行数:68,代码来源:signal_32.c



注:本文中的sigdelsetmask函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ sigemptyset函数代码示例发布时间:2022-05-30
下一篇:
C++ sigdelset函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap