Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern use EMUL_GETPID_PASS_PPID or EMUL_GETID_PASS_EID to...



details:   https://anonhg.NetBSD.org/src/rev/1f9c8066cd0d
branches:  trunk
changeset: 499919:1f9c8066cd0d
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Fri Dec 01 20:34:17 2000 +0000

description:
use EMUL_GETPID_PASS_PPID or EMUL_GETID_PASS_EID to find out if one should
pass parent pid for getpid() or effective id for get[ug]id(), instead
of compile-time dependency

diffstat:

 sys/kern/kern_prot.c |  28 +++++++++++-----------------
 1 files changed, 11 insertions(+), 17 deletions(-)

diffs (67 lines):

diff -r 71cba93b6d95 -r 1f9c8066cd0d sys/kern/kern_prot.c
--- a/sys/kern/kern_prot.c      Fri Dec 01 20:31:13 2000 +0000
+++ b/sys/kern/kern_prot.c      Fri Dec 01 20:34:17 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_prot.c,v 1.60 2000/10/17 23:38:55 christos Exp $  */
+/*     $NetBSD: kern_prot.c,v 1.61 2000/12/01 20:34:17 jdolecek Exp $  */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1990, 1991, 1993
@@ -44,12 +44,7 @@
  * System calls related to processes and protection
  */
 
-#include "opt_compat_freebsd.h"
-#include "opt_compat_ibcs2.h"
-#include "opt_compat_sunos.h"
-#include "opt_compat_linux.h"
 #include "opt_compat_43.h"
-#include "opt_compat_osf1.h"
 
 #include <sys/param.h>
 #include <sys/acct.h>
@@ -72,11 +67,11 @@
 {
 
        *retval = p->p_pid;
-#if defined(COMPAT_43) || defined(COMPAT_SUNOS) || defined(COMPAT_IBCS2) || \
-    defined(COMPAT_FREEBSD) || defined(COMPAT_OSF1) || \
-    (defined(COMPAT_LINUX) && defined(__alpha__))
-       retval[1] = p->p_pptr->p_pid;
+#ifndef COMPAT_43
+       if (p->p_emul->e_flags & EMUL_GETPID_PASS_PPID)
 #endif
+       
+               retval[1] = p->p_pptr->p_pid;
        return (0);
 }
 
@@ -155,11 +150,10 @@
 {
 
        *retval = p->p_cred->p_ruid;
-#if defined(COMPAT_43) || defined(COMPAT_SUNOS) || defined(COMPAT_IBCS2) || \
-    defined(COMPAT_FREEBSD) || defined(COMPAT_OSF1) || \
-    (defined(COMPAT_LINUX) && defined(__alpha__))
-       retval[1] = p->p_ucred->cr_uid;
+#ifndef COMPAT_43
+       if (p->p_emul->e_flags & EMUL_GETID_PASS_EID)
 #endif
+               retval[1] = p->p_ucred->cr_uid;
        return (0);
 }
 
@@ -184,10 +178,10 @@
 {
 
        *retval = p->p_cred->p_rgid;
-#if defined(COMPAT_43) || defined(COMPAT_SUNOS) || defined(COMPAT_FREEBSD) || \
-    defined(COMPAT_OSF1) || (defined(COMPAT_LINUX) && defined(alpha))
-       retval[1] = p->p_ucred->cr_gid;
+#ifndef COMPAT_43
+       if (p->p_emul->e_flags & EMUL_GETID_PASS_EID)
 #endif
+               retval[1] = p->p_ucred->cr_gid;
        return (0);
 }
 



Home | Main Index | Thread Index | Old Index