From owner-p4-projects@FreeBSD.ORG Sun Aug 6 11:05:41 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AD6A816A4E1; Sun, 6 Aug 2006 11:05:41 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8773516A4DD for ; Sun, 6 Aug 2006 11:05:41 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4DE8643D55 for ; Sun, 6 Aug 2006 11:05:41 +0000 (GMT) (envelope-from rdivacky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k76B5fVK042700 for ; Sun, 6 Aug 2006 11:05:41 GMT (envelope-from rdivacky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k76B5fAU042697 for perforce@freebsd.org; Sun, 6 Aug 2006 11:05:41 GMT (envelope-from rdivacky@FreeBSD.org) Date: Sun, 6 Aug 2006 11:05:41 GMT Message-Id: <200608061105.k76B5fAU042697@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to rdivacky@FreeBSD.org using -f From: Roman Divacky To: Perforce Change Reviews Cc: Subject: PERFORCE change 103328 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Aug 2006 11:05:41 -0000 http://perforce.freebsd.org/chv.cgi?CH=103328 Change 103328 by rdivacky@rdivacky_witten on 2006/08/06 11:04:59 Implementation of linux_tgkill() syscall. Firefox uses it. Affected files ... .. //depot/projects/soc2006/rdivacky_linuxolator/compat/linux/linux_signal.c#2 edit .. //depot/projects/soc2006/rdivacky_linuxolator/i386/linux/linux_dummy.c#9 edit Differences ... ==== //depot/projects/soc2006/rdivacky_linuxolator/compat/linux/linux_signal.c#2 (text+ko) ==== @@ -50,6 +50,9 @@ #include #include +struct linux_emuldata *em_find(pid_t pid, int locked); +extern struct rwlock emul_lock; + void linux_to_bsd_sigset(l_sigset_t *lss, sigset_t *bss) { @@ -447,3 +450,46 @@ tmp.pid = args->pid; return (kill(td, &tmp)); } + +int +linux_tgkill(struct thread *td, struct linux_tgkill_args *args) +{ + struct linux_emuldata *em; + struct linux_kill_args ka; + struct proc *p; + +#ifdef DEBUG + if (ldebug(tgkill)) + printf(ARGS(tgkill, "%d, %d, %d"), args->tgid, args->pid, args->sig); +#endif + + ka.pid = args->pid; + ka.signum = args->sig; + + if (args->tgid == -1) + return linux_kill(td, &ka); + + if ((p = pfind(args->pid)) == NULL) + return ESRCH; + + if (p->p_sysent != &elf_linux_sysvec) + return ESRCH; + + PROC_UNLOCK(p); + + em = em_find(args->pid, EMUL_UNLOCKED); + + if (em == NULL) { +#ifdef DEBUG + printf("emuldata not found.\n"); +#endif + return ESRCH; + } + + if (em->shared->group_pid != args->tgid) + return ESRCH; + + EMUL_RUNLOCK(&emul_lock); + + return linux_kill(td, &ka); +} ==== //depot/projects/soc2006/rdivacky_linuxolator/i386/linux/linux_dummy.c#9 (text+ko) ==== @@ -75,7 +75,6 @@ DUMMY(remap_file_pages); DUMMY(statfs64); DUMMY(fstatfs64); -DUMMY(tgkill); DUMMY(utimes); DUMMY(fadvise64_64); DUMMY(mbind);