Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Define 3 new functions:



details:   https://anonhg.NetBSD.org/src/rev/a1ed7f0c9132
branches:  trunk
changeset: 500276:a1ed7f0c9132
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Sat Dec 09 07:04:47 2000 +0000

description:
Define 3 new functions:
* sys_getpid_with_ppid()
* sys_getuid_with_euid()
* sys_getgid_with_egid()
that do the retval[1] hack.  Use them when COMPAT_43 is defined.

diffstat:

 sys/kern/kern_prot.c     |  54 +++++++++++++++++++++++++++++++++++------------
 sys/kern/syscalls.master |  14 +++++++++++-
 2 files changed, 53 insertions(+), 15 deletions(-)

diffs (124 lines):

diff -r 649d64eef867 -r a1ed7f0c9132 sys/kern/kern_prot.c
--- a/sys/kern/kern_prot.c      Sat Dec 09 06:54:27 2000 +0000
+++ b/sys/kern/kern_prot.c      Sat Dec 09 07:04:47 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_prot.c,v 1.61 2000/12/01 20:34:17 jdolecek Exp $  */
+/*     $NetBSD: kern_prot.c,v 1.62 2000/12/09 07:04:47 mycroft Exp $   */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1990, 1991, 1993
@@ -67,11 +67,19 @@
 {
 
        *retval = p->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);
+}
+
+/* ARGSUSED */
+int
+sys_getpid_with_ppid(p, v, retval)
+       struct proc *p;
+       void *v;
+       register_t *retval;
+{
+
+       retval[0] = p->p_pid;
+       retval[1] = p->p_pptr->p_pid;
        return (0);
 }
 
@@ -150,10 +158,19 @@
 {
 
        *retval = p->p_cred->p_ruid;
-#ifndef COMPAT_43
-       if (p->p_emul->e_flags & EMUL_GETID_PASS_EID)
-#endif
-               retval[1] = p->p_ucred->cr_uid;
+       return (0);
+}
+
+/* ARGSUSED */
+int
+sys_getuid_with_euid(p, v, retval)
+       struct proc *p;
+       void *v;
+       register_t *retval;
+{
+
+       retval[0] = p->p_cred->p_ruid;
+       retval[1] = p->p_ucred->cr_uid;
        return (0);
 }
 
@@ -178,10 +195,19 @@
 {
 
        *retval = p->p_cred->p_rgid;
-#ifndef COMPAT_43
-       if (p->p_emul->e_flags & EMUL_GETID_PASS_EID)
-#endif
-               retval[1] = p->p_ucred->cr_gid;
+       return (0);
+}
+
+/* ARGSUSED */
+int
+sys_getgid_with_egid(p, v, retval)
+       struct proc *p;
+       void *v;
+       register_t *retval;
+{
+
+       retval[0] = p->p_cred->p_rgid;
+       retval[1] = p->p_ucred->cr_gid;
        return (0);
 }
 
diff -r 649d64eef867 -r a1ed7f0c9132 sys/kern/syscalls.master
--- a/sys/kern/syscalls.master  Sat Dec 09 06:54:27 2000 +0000
+++ b/sys/kern/syscalls.master  Sat Dec 09 07:04:47 2000 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.103 2000/12/09 05:27:31 mycroft Exp $
+       $NetBSD: syscalls.master,v 1.104 2000/12/09 07:04:48 mycroft Exp $
 
 ;      @(#)syscalls.master     8.2 (Berkeley) 1/13/94
 
@@ -85,12 +85,20 @@
                            int flags); }
 19     COMPAT_43       { long sys_lseek(int fd, long offset, int whence); } \
                            olseek
+#ifdef COMPAT_43
+20     STD             { pid_t sys_getpid_with_ppid(void); } getpid
+#else
 20     STD             { pid_t sys_getpid(void); }
+#endif
 21     STD             { int sys_mount(const char *type, const char *path, \
                            int flags, void *data); }
 22     STD             { int sys_unmount(const char *path, int flags); }
 23     STD             { int sys_setuid(uid_t uid); }
+#ifdef COMPAT_43
+24     STD             { uid_t sys_getuid_with_euid(void); } getuid
+#else
 24     STD             { uid_t sys_getuid(void); }
+#endif
 25     STD             { uid_t sys_geteuid(void); }
 26     STD             { int sys_ptrace(int req, pid_t pid, caddr_t addr, \
                            int data); }
@@ -131,7 +139,11 @@
 46     COMPAT_13       { int sys_sigaction(int signum, \
                            const struct sigaction13 *nsa, \
                            struct sigaction13 *osa); } sigaction13
+#ifdef COMPAT_43
+47     STD             { gid_t sys_getgid_with_egid(void); } getgid
+#else
 47     STD             { gid_t sys_getgid(void); }
+#endif
 48     COMPAT_13       { int sys_sigprocmask(int how, \
                            int mask); } sigprocmask13
 49     STD             { int sys___getlogin(char *namebuf, size_t namelen); }



Home | Main Index | Thread Index | Old Index