linux_misc.c (165867) | linux_misc.c (165869) |
---|---|
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 165867 2007-01-07 19:00:38Z netchild $"); | 31__FBSDID("$FreeBSD: head/sys/compat/linux/linux_misc.c 165869 2007-01-07 19:14:06Z netchild $"); |
32 33#include "opt_compat.h" 34#include "opt_mac.h" 35 36#include <sys/param.h> 37#include <sys/blist.h> 38#include <sys/fcntl.h> 39#if defined(__i386__) --- 1394 unchanged lines hidden (view full) --- 1434 struct linux_emuldata *em; 1435 1436#ifdef DEBUG 1437 if (ldebug(getpid)) 1438 printf(ARGS(getpid, "")); 1439#endif 1440 1441 if (linux_use26(td)) { | 32 33#include "opt_compat.h" 34#include "opt_mac.h" 35 36#include <sys/param.h> 37#include <sys/blist.h> 38#include <sys/fcntl.h> 39#if defined(__i386__) --- 1394 unchanged lines hidden (view full) --- 1434 struct linux_emuldata *em; 1435 1436#ifdef DEBUG 1437 if (ldebug(getpid)) 1438 printf(ARGS(getpid, "")); 1439#endif 1440 1441 if (linux_use26(td)) { |
1442 em = em_find(td->td_proc, EMUL_DOLOCK); | 1442 em = em_find(td->td_proc, EMUL_DONTLOCK); |
1443 KASSERT(em != NULL, ("getpid: emuldata not found.\n")); 1444 td->td_retval[0] = em->shared->group_pid; | 1443 KASSERT(em != NULL, ("getpid: emuldata not found.\n")); 1444 td->td_retval[0] = em->shared->group_pid; |
1445 EMUL_UNLOCK(&emul_lock); | |
1446 } else { 1447 td->td_retval[0] = td->td_proc->p_pid; 1448 } 1449 1450 return (0); 1451} 1452 1453int --- 22 unchanged lines hidden (view full) --- 1476 1477 if (!linux_use26(td)) { 1478 PROC_LOCK(td->td_proc); 1479 td->td_retval[0] = td->td_proc->p_pptr->p_pid; 1480 PROC_UNLOCK(td->td_proc); 1481 return (0); 1482 } 1483 | 1445 } else { 1446 td->td_retval[0] = td->td_proc->p_pid; 1447 } 1448 1449 return (0); 1450} 1451 1452int --- 22 unchanged lines hidden (view full) --- 1475 1476 if (!linux_use26(td)) { 1477 PROC_LOCK(td->td_proc); 1478 td->td_retval[0] = td->td_proc->p_pptr->p_pid; 1479 PROC_UNLOCK(td->td_proc); 1480 return (0); 1481 } 1482 |
1484 em = em_find(td->td_proc, EMUL_DOLOCK); | 1483 em = em_find(td->td_proc, EMUL_DONTLOCK); |
1485 1486 KASSERT(em != NULL, ("getppid: process emuldata not found.\n")); 1487 1488 /* find the group leader */ 1489 p = pfind(em->shared->group_pid); 1490 1491 if (p == NULL) { 1492#ifdef DEBUG --- 10 unchanged lines hidden (view full) --- 1503 if (pp->p_sysent == &elf_linux_sysvec) { 1504 em = em_find(pp, EMUL_DONTLOCK); 1505 KASSERT(em != NULL, ("getppid: parent emuldata not found.\n")); 1506 1507 td->td_retval[0] = em->shared->group_pid; 1508 } else 1509 td->td_retval[0] = pp->p_pid; 1510 | 1484 1485 KASSERT(em != NULL, ("getppid: process emuldata not found.\n")); 1486 1487 /* find the group leader */ 1488 p = pfind(em->shared->group_pid); 1489 1490 if (p == NULL) { 1491#ifdef DEBUG --- 10 unchanged lines hidden (view full) --- 1502 if (pp->p_sysent == &elf_linux_sysvec) { 1503 em = em_find(pp, EMUL_DONTLOCK); 1504 KASSERT(em != NULL, ("getppid: parent emuldata not found.\n")); 1505 1506 td->td_retval[0] = em->shared->group_pid; 1507 } else 1508 td->td_retval[0] = pp->p_pid; 1509 |
1511 EMUL_UNLOCK(&emul_lock); | |
1512 PROC_UNLOCK(pp); 1513 1514 return (0); 1515} 1516 1517int 1518linux_getgid(struct thread *td, struct linux_getgid_args *args) 1519{ --- 196 unchanged lines hidden --- | 1510 PROC_UNLOCK(pp); 1511 1512 return (0); 1513} 1514 1515int 1516linux_getgid(struct thread *td, struct linux_getgid_args *args) 1517{ --- 196 unchanged lines hidden --- |