linux_misc.c (202341) | linux_misc.c (215664) |
---|---|
1/*- 2 * Copyright (c) 2002 Doug Rabson 3 * Copyright (c) 1994-1995 S�ren Schmidt 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 14 unchanged lines hidden (view full) --- 23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2002 Doug Rabson 3 * Copyright (c) 1994-1995 S�ren Schmidt 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 14 unchanged lines hidden (view full) --- 23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/compat/linux/linux_misc.c 202341 2010-01-15 07:05:00Z brooks $"); | 31__FBSDID("$FreeBSD: head/sys/compat/linux/linux_misc.c 215664 2010-11-22 09:06:59Z netchild $"); |
32 33#include "opt_compat.h" 34 35#include <sys/param.h> 36#include <sys/blist.h> 37#include <sys/fcntl.h> 38#if defined(__i386__) 39#include <sys/imgact_aout.h> --- 1650 unchanged lines hidden (view full) --- 1690 name[1] = KERN_NISDOMAINNAME; 1691 return (userland_sysctl(td, name, 2, 0, 0, 0, args->name, 1692 args->len, 0, 0)); 1693} 1694 1695int 1696linux_exit_group(struct thread *td, struct linux_exit_group_args *args) 1697{ | 32 33#include "opt_compat.h" 34 35#include <sys/param.h> 36#include <sys/blist.h> 37#include <sys/fcntl.h> 38#if defined(__i386__) 39#include <sys/imgact_aout.h> --- 1650 unchanged lines hidden (view full) --- 1690 name[1] = KERN_NISDOMAINNAME; 1691 return (userland_sysctl(td, name, 2, 0, 0, 0, args->name, 1692 args->len, 0, 0)); 1693} 1694 1695int 1696linux_exit_group(struct thread *td, struct linux_exit_group_args *args) 1697{ |
1698 struct linux_emuldata *em, *td_em, *tmp_em; 1699 struct proc *sp; | 1698 struct linux_emuldata *em; |
1700 1701#ifdef DEBUG 1702 if (ldebug(exit_group)) 1703 printf(ARGS(exit_group, "%i"), args->error_code); 1704#endif 1705 | 1699 1700#ifdef DEBUG 1701 if (ldebug(exit_group)) 1702 printf(ARGS(exit_group, "%i"), args->error_code); 1703#endif 1704 |
1706 if (linux_use26(td)) { 1707 td_em = em_find(td->td_proc, EMUL_DONTLOCK); 1708 1709 KASSERT(td_em != NULL, ("exit_group: emuldata not found.\n")); 1710 1711 EMUL_SHARED_RLOCK(&emul_shared_lock); 1712 LIST_FOREACH_SAFE(em, &td_em->shared->threads, threads, tmp_em) { 1713 if (em->pid == td_em->pid) 1714 continue; 1715 1716 sp = pfind(em->pid); 1717 psignal(sp, SIGKILL); 1718 PROC_UNLOCK(sp); 1719#ifdef DEBUG 1720 printf(LMSG("linux_sys_exit_group: kill PID %d\n"), em->pid); 1721#endif 1722 } 1723 1724 EMUL_SHARED_RUNLOCK(&emul_shared_lock); | 1705 em = em_find(td->td_proc, EMUL_DONTLOCK); 1706 if (em->shared->refs > 1) { 1707 EMUL_SHARED_WLOCK(&emul_shared_lock); 1708 em->shared->flags |= EMUL_SHARED_HASXSTAT; 1709 em->shared->xstat = W_EXITCODE(args->error_code, 0); 1710 EMUL_SHARED_WUNLOCK(&emul_shared_lock); 1711 if (linux_use26(td)) 1712 linux_kill_threads(td, SIGKILL); |
1725 } | 1713 } |
1714 |
|
1726 /* 1727 * XXX: we should send a signal to the parent if 1728 * SIGNAL_EXIT_GROUP is set. We ignore that (temporarily?) 1729 * as it doesnt occur often. 1730 */ 1731 exit1(td, W_EXITCODE(args->error_code, 0)); 1732 1733 return (0); --- 135 unchanged lines hidden --- | 1715 /* 1716 * XXX: we should send a signal to the parent if 1717 * SIGNAL_EXIT_GROUP is set. We ignore that (temporarily?) 1718 * as it doesnt occur often. 1719 */ 1720 exit1(td, W_EXITCODE(args->error_code, 0)); 1721 1722 return (0); --- 135 unchanged lines hidden --- |