diff options
author | jasoni <jasoni@cvs.openbsd.org> | 2002-06-05 19:43:26 +0000 |
---|---|---|
committer | jasoni <jasoni@cvs.openbsd.org> | 2002-06-05 19:43:26 +0000 |
commit | 4bed8e3cfea9090e7c0f12c763c3f8bfb6703594 (patch) | |
tree | d0cef0d346a4709c2dcb9e41523d88230f40671a /sys/compat | |
parent | 24c1324e0fd43810d5c97814e3b5f3a6bb71a6a7 (diff) |
provide local versions of getpid, getuid and getgid that do not
stuff a value in retval[1] as newer linux libs puke on it.
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/linux/linux_misc.c | 35 | ||||
-rw-r--r-- | sys/compat/linux/syscalls.master | 12 |
2 files changed, 40 insertions, 7 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 17ed62e7b22..4054b4f4f48 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: linux_misc.c,v 1.42 2002/03/14 20:31:31 mickey Exp $ */ +/* $OpenBSD: linux_misc.c,v 1.43 2002/06/05 19:43:25 jasoni Exp $ */ /* $NetBSD: linux_misc.c,v 1.27 1996/05/20 01:59:21 fvdl Exp $ */ /* @@ -1487,3 +1487,36 @@ linux_sys_stime(p, v, retval) return 0; } + +int +linux_sys_getpid(p, v, retval) + struct proc *p; + void *v; + register_t *retval; +{ + + *retval = p->p_pid; + return (0); +} + +int +linux_sys_getuid(p, v, retval) + struct proc *p; + void *v; + register_t *retval; +{ + + *retval = p->p_cred->p_ruid; + return (0); +} + +int +linux_sys_getgid(p, v, retval) + struct proc *p; + void *v; + register_t *retval; +{ + + *retval = p->p_cred->p_rgid; + return (0); +} diff --git a/sys/compat/linux/syscalls.master b/sys/compat/linux/syscalls.master index 14983087f82..644738e1985 100644 --- a/sys/compat/linux/syscalls.master +++ b/sys/compat/linux/syscalls.master @@ -1,4 +1,4 @@ - $OpenBSD: syscalls.master,v 1.33 2002/03/14 00:42:25 miod Exp $ + $OpenBSD: syscalls.master,v 1.34 2002/06/05 19:43:25 jasoni Exp $ ; $NetBSD: syscalls.master,v 1.15 1995/12/18 14:35:10 fvdl Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -68,12 +68,12 @@ 18 STD { int linux_sys_ostat(void); } 19 NOARGS { long compat_43_sys_lseek(int fd, long offset, \ int whence); } -20 NOARGS { pid_t sys_getpid(void); } +20 STD { pid_t linux_sys_getpid(void); } 21 STD { int linux_sys_mount(char *specialfile, char *dir, \ char *filesystemtype, long rwflag, void *data); } 22 STD { int linux_sys_umount(char *specialfile); } 23 NOARGS linux_setuid16 { int sys_setuid(uid_t uid); } -24 NOARGS linux_getuid16 { uid_t sys_getuid(void); } +24 STD linux_getuid16 { uid_t linux_sys_getuid(void); } 25 STD { int linux_sys_stime(linux_time_t *t); } #ifdef PTRACE 26 STD { int linux_sys_ptrace(void); } @@ -101,7 +101,7 @@ 44 STD { int linux_sys_prof(void); } 45 STD { int linux_sys_brk(char *nsize); } 46 NOARGS linux_setgid16 { int sys_setgid(gid_t gid); } -47 NOARGS linux_getgid16 { gid_t sys_getgid(void); } +47 STD linux_getgid16 { gid_t linux_sys_getgid(void); } 48 STD { int linux_sys_signal(int sig, \ linux_handler_t handler); } 49 NOARGS linux_geteuid16 { uid_t sys_geteuid(void); } @@ -327,8 +327,8 @@ 197 STD { int linux_sys_fstat64(int fd, \ struct linux_stat64 *sp); } 198 NOARGS { int linux_sys_lchown(void); } -199 NOARGS { uid_t sys_getuid(void); } -200 NOARGS { gid_t sys_getgid(void); } +199 STD { uid_t linux_sys_getuid(void); } +200 STD { gid_t linux_sys_getgid(void); } 201 NOARGS { uid_t sys_geteuid(void); } 202 NOARGS { gid_t sys_getegid(void); } 203 NOARGS { int linux_sys_setreuid(void); } |