[BACK]Return to linux_signal.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / compat / linux / common

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/compat/linux/common/linux_signal.c between version 1.69.4.2 and 1.70

version 1.69.4.2, 2011/03/05 20:52:50 version 1.70, 2010/07/01 02:38:29
Line 69  __KERNEL_RCSID(0, "$NetBSD$");
Line 69  __KERNEL_RCSID(0, "$NetBSD$");
   
 #include <compat/linux/common/linux_types.h>  #include <compat/linux/common/linux_types.h>
 #include <compat/linux/common/linux_signal.h>  #include <compat/linux/common/linux_signal.h>
 #include <compat/linux/common/linux_emuldata.h>  #include <compat/linux/common/linux_exec.h> /* For emul_linux */
   #include <compat/linux/common/linux_machdep.h> /* For LINUX_NPTL */
   #include <compat/linux/common/linux_emuldata.h> /* for linux_emuldata */
 #include <compat/linux/common/linux_siginfo.h>  #include <compat/linux/common/linux_siginfo.h>
 #include <compat/linux/common/linux_sigevent.h>  #include <compat/linux/common/linux_sigevent.h>
 #include <compat/linux/common/linux_util.h>  #include <compat/linux/common/linux_util.h>
Line 607  linux_sys_sigaltstack(struct lwp *l, con
Line 609  linux_sys_sigaltstack(struct lwp *l, con
 }  }
 #endif /* LINUX_SS_ONSTACK */  #endif /* LINUX_SS_ONSTACK */
   
   #ifdef LINUX_NPTL
 static int  static int
 linux_do_tkill(struct lwp *l, int tgid, int tid, int signum)  linux_do_tkill(struct lwp *l, int tgid, int tid, int signum)
 {  {
         struct proc *p;          struct proc *p;
         struct lwp *t;  
         ksiginfo_t ksi;  
         int error;          int error;
           ksiginfo_t ksi;
           struct linux_emuldata *led;
   
         if (signum < 0 || signum >= LINUX__NSIG)          if (signum < 0 || signum >= LINUX__NSIG)
                 return EINVAL;                  return EINVAL;
         signum = linux_to_native_signo[signum];          signum = linux_to_native_signo[signum];
   
         if (tgid == -1) {  
                 tgid = tid;  
         }  
   
         KSI_INIT(&ksi);          KSI_INIT(&ksi);
         ksi.ksi_signo = signum;          ksi.ksi_signo = signum;
         ksi.ksi_code = SI_LWP;          ksi.ksi_code = SI_LWP;
         ksi.ksi_pid = l->l_proc->p_pid;          ksi.ksi_pid = l->l_proc->p_pid;
         ksi.ksi_uid = kauth_cred_geteuid(l->l_cred);          ksi.ksi_uid = kauth_cred_geteuid(l->l_cred);
         ksi.ksi_lid = tid;  
   
         mutex_enter(proc_lock);          mutex_enter(proc_lock);
         p = proc_find(tgid);          if ((p = proc_find(tid)) == NULL) {
         if (p == NULL) {                  mutex_exit(proc_lock);
                   return ESRCH;
           }
           led = p->p_emuldata;
           if (tgid > 0 && led->s->group_pid != tgid) {
                 mutex_exit(proc_lock);                  mutex_exit(proc_lock);
                 return ESRCH;                  return ESRCH;
         }          }
         mutex_enter(p->p_lock);          mutex_enter(p->p_lock);
         error = kauth_authorize_process(l->l_cred,          error = kauth_authorize_process(l->l_cred,
             KAUTH_PROCESS_SIGNAL, p, KAUTH_ARG(signum), NULL, NULL);              KAUTH_PROCESS_SIGNAL, p, KAUTH_ARG(signum), NULL, NULL);
         if ((t = lwp_find(p, ksi.ksi_lid)) == NULL)          if (!error && signum)
                 error = ESRCH;  
         else if (signum != 0)  
                 kpsignal2(p, &ksi);                  kpsignal2(p, &ksi);
         mutex_exit(p->p_lock);          mutex_exit(p->p_lock);
         mutex_exit(proc_lock);          mutex_exit(proc_lock);
Line 660  linux_sys_tkill(struct lwp *l, const str
Line 660  linux_sys_tkill(struct lwp *l, const str
         if (SCARG(uap, tid) <= 0)          if (SCARG(uap, tid) <= 0)
                 return EINVAL;                  return EINVAL;
   
         return linux_do_tkill(l, -1, SCARG(uap, tid), SCARG(uap, sig));          return linux_do_tkill(l, 0, SCARG(uap, tid), SCARG(uap, sig));
 }  }
   
 int  int
Line 672  linux_sys_tgkill(struct lwp *l, const st
Line 672  linux_sys_tgkill(struct lwp *l, const st
                 syscallarg(int) sig;                  syscallarg(int) sig;
         } */          } */
   
         if (SCARG(uap, tid) <= 0 || SCARG(uap, tgid) < -1)          if (SCARG(uap, tid) <= 0 || SCARG(uap, tgid) <= 0)
                 return EINVAL;                  return EINVAL;
   
         return linux_do_tkill(l, SCARG(uap, tgid), SCARG(uap, tid), SCARG(uap, sig));          return linux_do_tkill(l, SCARG(uap, tgid), SCARG(uap, tid), SCARG(uap, sig));
 }  }
   #endif /* LINUX_NPTL */
   
 int  int
 native_to_linux_si_code(int code)  native_to_linux_si_code(int code)

Legend:
Removed from v.1.69.4.2  
changed lines
  Added in v.1.70

CVSweb <webmaster@jp.NetBSD.org>