Linux's getsid(2) does in fact return a pid, not a pointer.

This commit is contained in:
mycroft 1998-02-20 18:09:04 +00:00
parent 663644670d
commit 26c238db7d
19 changed files with 22 additions and 550 deletions

View File

@ -1,4 +1,4 @@
$NetBSD: syscalls.master,v 1.22 1998/02/19 00:41:12 thorpej Exp $
$NetBSD: syscalls.master,v 1.23 1998/02/20 18:09:04 mycroft Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@ -238,7 +238,7 @@
u_int iovcnt); }
146 NOARGS { int sys_writev(int fd, struct iovec *iovp, \
u_int iovcnt); }
147 STD { int linux_sys_getsid(int pid); }
147 NOARGS { pid_t sys_getsid(pid_t pid); }
148 STD { int linux_sys_fdatasync(int fd); }
149 STD { int linux_sys___sysctl(struct linux___sysctl *lsp); }
150 NOARGS { int sys_mlock(caddr_t addr, size_t len); }

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_break.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/* $NetBSD: linux_break.c,v 1.38 1998/02/20 18:09:04 mycroft Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -1139,39 +1139,6 @@ linux_sys_setregid(p, v, retval)
return sys_setregid(p, &bsa, retval);
}
int
linux_sys_getsid(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
struct linux_sys_getsid_args /* {
syscallarg(int) pid;
} */ *uap = v;
struct proc *p1;
pid_t pid;
/*
* NOTE: The Linux getsid(2) is different from the XPG getsid(2),
* which is defined to return the process group ID of the session
* leader. Insetead, Linux returns the pointer to the session.
*/
pid = (pid_t)SCARG(uap, pid);
if (pid == 0) {
retval[0] = (register_t)p->p_session;
return 0;
}
p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
retval[0] = (register_t)p1->p_session;
return 0;
}
int
linux_sys___sysctl(p, v, retval)
struct proc *p;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_misc.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/* $NetBSD: linux_misc.c,v 1.38 1998/02/20 18:09:04 mycroft Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -1139,39 +1139,6 @@ linux_sys_setregid(p, v, retval)
return sys_setregid(p, &bsa, retval);
}
int
linux_sys_getsid(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
struct linux_sys_getsid_args /* {
syscallarg(int) pid;
} */ *uap = v;
struct proc *p1;
pid_t pid;
/*
* NOTE: The Linux getsid(2) is different from the XPG getsid(2),
* which is defined to return the process group ID of the session
* leader. Insetead, Linux returns the pointer to the session.
*/
pid = (pid_t)SCARG(uap, pid);
if (pid == 0) {
retval[0] = (register_t)p->p_session;
return 0;
}
p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
retval[0] = (register_t)p1->p_session;
return 0;
}
int
linux_sys___sysctl(p, v, retval)
struct proc *p;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_misc_notalpha.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/* $NetBSD: linux_misc_notalpha.c,v 1.38 1998/02/20 18:09:04 mycroft Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -1139,39 +1139,6 @@ linux_sys_setregid(p, v, retval)
return sys_setregid(p, &bsa, retval);
}
int
linux_sys_getsid(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
struct linux_sys_getsid_args /* {
syscallarg(int) pid;
} */ *uap = v;
struct proc *p1;
pid_t pid;
/*
* NOTE: The Linux getsid(2) is different from the XPG getsid(2),
* which is defined to return the process group ID of the session
* leader. Insetead, Linux returns the pointer to the session.
*/
pid = (pid_t)SCARG(uap, pid);
if (pid == 0) {
retval[0] = (register_t)p->p_session;
return 0;
}
p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
retval[0] = (register_t)p1->p_session;
return 0;
}
int
linux_sys___sysctl(p, v, retval)
struct proc *p;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_oldmmap.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/* $NetBSD: linux_oldmmap.c,v 1.38 1998/02/20 18:09:04 mycroft Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -1139,39 +1139,6 @@ linux_sys_setregid(p, v, retval)
return sys_setregid(p, &bsa, retval);
}
int
linux_sys_getsid(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
struct linux_sys_getsid_args /* {
syscallarg(int) pid;
} */ *uap = v;
struct proc *p1;
pid_t pid;
/*
* NOTE: The Linux getsid(2) is different from the XPG getsid(2),
* which is defined to return the process group ID of the session
* leader. Insetead, Linux returns the pointer to the session.
*/
pid = (pid_t)SCARG(uap, pid);
if (pid == 0) {
retval[0] = (register_t)p->p_session;
return 0;
}
p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
retval[0] = (register_t)p1->p_session;
return 0;
}
int
linux_sys___sysctl(p, v, retval)
struct proc *p;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_oldolduname.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/* $NetBSD: linux_oldolduname.c,v 1.38 1998/02/20 18:09:04 mycroft Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -1139,39 +1139,6 @@ linux_sys_setregid(p, v, retval)
return sys_setregid(p, &bsa, retval);
}
int
linux_sys_getsid(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
struct linux_sys_getsid_args /* {
syscallarg(int) pid;
} */ *uap = v;
struct proc *p1;
pid_t pid;
/*
* NOTE: The Linux getsid(2) is different from the XPG getsid(2),
* which is defined to return the process group ID of the session
* leader. Insetead, Linux returns the pointer to the session.
*/
pid = (pid_t)SCARG(uap, pid);
if (pid == 0) {
retval[0] = (register_t)p->p_session;
return 0;
}
p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
retval[0] = (register_t)p1->p_session;
return 0;
}
int
linux_sys___sysctl(p, v, retval)
struct proc *p;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_oldselect.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/* $NetBSD: linux_oldselect.c,v 1.38 1998/02/20 18:09:04 mycroft Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -1139,39 +1139,6 @@ linux_sys_setregid(p, v, retval)
return sys_setregid(p, &bsa, retval);
}
int
linux_sys_getsid(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
struct linux_sys_getsid_args /* {
syscallarg(int) pid;
} */ *uap = v;
struct proc *p1;
pid_t pid;
/*
* NOTE: The Linux getsid(2) is different from the XPG getsid(2),
* which is defined to return the process group ID of the session
* leader. Insetead, Linux returns the pointer to the session.
*/
pid = (pid_t)SCARG(uap, pid);
if (pid == 0) {
retval[0] = (register_t)p->p_session;
return 0;
}
p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
retval[0] = (register_t)p1->p_session;
return 0;
}
int
linux_sys___sysctl(p, v, retval)
struct proc *p;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_olduname.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/* $NetBSD: linux_olduname.c,v 1.38 1998/02/20 18:09:04 mycroft Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -1139,39 +1139,6 @@ linux_sys_setregid(p, v, retval)
return sys_setregid(p, &bsa, retval);
}
int
linux_sys_getsid(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
struct linux_sys_getsid_args /* {
syscallarg(int) pid;
} */ *uap = v;
struct proc *p1;
pid_t pid;
/*
* NOTE: The Linux getsid(2) is different from the XPG getsid(2),
* which is defined to return the process group ID of the session
* leader. Insetead, Linux returns the pointer to the session.
*/
pid = (pid_t)SCARG(uap, pid);
if (pid == 0) {
retval[0] = (register_t)p->p_session;
return 0;
}
p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
retval[0] = (register_t)p1->p_session;
return 0;
}
int
linux_sys___sysctl(p, v, retval)
struct proc *p;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_pipe.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/* $NetBSD: linux_pipe.c,v 1.38 1998/02/20 18:09:04 mycroft Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -1139,39 +1139,6 @@ linux_sys_setregid(p, v, retval)
return sys_setregid(p, &bsa, retval);
}
int
linux_sys_getsid(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
struct linux_sys_getsid_args /* {
syscallarg(int) pid;
} */ *uap = v;
struct proc *p1;
pid_t pid;
/*
* NOTE: The Linux getsid(2) is different from the XPG getsid(2),
* which is defined to return the process group ID of the session
* leader. Insetead, Linux returns the pointer to the session.
*/
pid = (pid_t)SCARG(uap, pid);
if (pid == 0) {
retval[0] = (register_t)p->p_session;
return 0;
}
p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
retval[0] = (register_t)p1->p_session;
return 0;
}
int
linux_sys___sysctl(p, v, retval)
struct proc *p;

View File

@ -1,4 +1,4 @@
$NetBSD: syscalls.master,v 1.22 1998/02/19 00:41:12 thorpej Exp $
$NetBSD: syscalls.master,v 1.23 1998/02/20 18:09:04 mycroft Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@ -238,7 +238,7 @@
u_int iovcnt); }
146 NOARGS { int sys_writev(int fd, struct iovec *iovp, \
u_int iovcnt); }
147 STD { int linux_sys_getsid(int pid); }
147 NOARGS { pid_t sys_getsid(pid_t pid); }
148 STD { int linux_sys_fdatasync(int fd); }
149 STD { int linux_sys___sysctl(struct linux___sysctl *lsp); }
150 NOARGS { int sys_mlock(caddr_t addr, size_t len); }

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_misc.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/* $NetBSD: linux_misc.c,v 1.38 1998/02/20 18:09:04 mycroft Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -1139,39 +1139,6 @@ linux_sys_setregid(p, v, retval)
return sys_setregid(p, &bsa, retval);
}
int
linux_sys_getsid(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
struct linux_sys_getsid_args /* {
syscallarg(int) pid;
} */ *uap = v;
struct proc *p1;
pid_t pid;
/*
* NOTE: The Linux getsid(2) is different from the XPG getsid(2),
* which is defined to return the process group ID of the session
* leader. Insetead, Linux returns the pointer to the session.
*/
pid = (pid_t)SCARG(uap, pid);
if (pid == 0) {
retval[0] = (register_t)p->p_session;
return 0;
}
p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
retval[0] = (register_t)p1->p_session;
return 0;
}
int
linux_sys___sysctl(p, v, retval)
struct proc *p;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_break.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/* $NetBSD: linux_break.c,v 1.38 1998/02/20 18:09:04 mycroft Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -1139,39 +1139,6 @@ linux_sys_setregid(p, v, retval)
return sys_setregid(p, &bsa, retval);
}
int
linux_sys_getsid(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
struct linux_sys_getsid_args /* {
syscallarg(int) pid;
} */ *uap = v;
struct proc *p1;
pid_t pid;
/*
* NOTE: The Linux getsid(2) is different from the XPG getsid(2),
* which is defined to return the process group ID of the session
* leader. Insetead, Linux returns the pointer to the session.
*/
pid = (pid_t)SCARG(uap, pid);
if (pid == 0) {
retval[0] = (register_t)p->p_session;
return 0;
}
p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
retval[0] = (register_t)p1->p_session;
return 0;
}
int
linux_sys___sysctl(p, v, retval)
struct proc *p;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_misc_notalpha.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/* $NetBSD: linux_misc_notalpha.c,v 1.38 1998/02/20 18:09:04 mycroft Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -1139,39 +1139,6 @@ linux_sys_setregid(p, v, retval)
return sys_setregid(p, &bsa, retval);
}
int
linux_sys_getsid(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
struct linux_sys_getsid_args /* {
syscallarg(int) pid;
} */ *uap = v;
struct proc *p1;
pid_t pid;
/*
* NOTE: The Linux getsid(2) is different from the XPG getsid(2),
* which is defined to return the process group ID of the session
* leader. Insetead, Linux returns the pointer to the session.
*/
pid = (pid_t)SCARG(uap, pid);
if (pid == 0) {
retval[0] = (register_t)p->p_session;
return 0;
}
p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
retval[0] = (register_t)p1->p_session;
return 0;
}
int
linux_sys___sysctl(p, v, retval)
struct proc *p;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_oldmmap.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/* $NetBSD: linux_oldmmap.c,v 1.38 1998/02/20 18:09:04 mycroft Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -1139,39 +1139,6 @@ linux_sys_setregid(p, v, retval)
return sys_setregid(p, &bsa, retval);
}
int
linux_sys_getsid(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
struct linux_sys_getsid_args /* {
syscallarg(int) pid;
} */ *uap = v;
struct proc *p1;
pid_t pid;
/*
* NOTE: The Linux getsid(2) is different from the XPG getsid(2),
* which is defined to return the process group ID of the session
* leader. Insetead, Linux returns the pointer to the session.
*/
pid = (pid_t)SCARG(uap, pid);
if (pid == 0) {
retval[0] = (register_t)p->p_session;
return 0;
}
p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
retval[0] = (register_t)p1->p_session;
return 0;
}
int
linux_sys___sysctl(p, v, retval)
struct proc *p;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_oldolduname.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/* $NetBSD: linux_oldolduname.c,v 1.38 1998/02/20 18:09:04 mycroft Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -1139,39 +1139,6 @@ linux_sys_setregid(p, v, retval)
return sys_setregid(p, &bsa, retval);
}
int
linux_sys_getsid(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
struct linux_sys_getsid_args /* {
syscallarg(int) pid;
} */ *uap = v;
struct proc *p1;
pid_t pid;
/*
* NOTE: The Linux getsid(2) is different from the XPG getsid(2),
* which is defined to return the process group ID of the session
* leader. Insetead, Linux returns the pointer to the session.
*/
pid = (pid_t)SCARG(uap, pid);
if (pid == 0) {
retval[0] = (register_t)p->p_session;
return 0;
}
p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
retval[0] = (register_t)p1->p_session;
return 0;
}
int
linux_sys___sysctl(p, v, retval)
struct proc *p;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_oldselect.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/* $NetBSD: linux_oldselect.c,v 1.38 1998/02/20 18:09:04 mycroft Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -1139,39 +1139,6 @@ linux_sys_setregid(p, v, retval)
return sys_setregid(p, &bsa, retval);
}
int
linux_sys_getsid(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
struct linux_sys_getsid_args /* {
syscallarg(int) pid;
} */ *uap = v;
struct proc *p1;
pid_t pid;
/*
* NOTE: The Linux getsid(2) is different from the XPG getsid(2),
* which is defined to return the process group ID of the session
* leader. Insetead, Linux returns the pointer to the session.
*/
pid = (pid_t)SCARG(uap, pid);
if (pid == 0) {
retval[0] = (register_t)p->p_session;
return 0;
}
p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
retval[0] = (register_t)p1->p_session;
return 0;
}
int
linux_sys___sysctl(p, v, retval)
struct proc *p;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_olduname.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/* $NetBSD: linux_olduname.c,v 1.38 1998/02/20 18:09:04 mycroft Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -1139,39 +1139,6 @@ linux_sys_setregid(p, v, retval)
return sys_setregid(p, &bsa, retval);
}
int
linux_sys_getsid(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
struct linux_sys_getsid_args /* {
syscallarg(int) pid;
} */ *uap = v;
struct proc *p1;
pid_t pid;
/*
* NOTE: The Linux getsid(2) is different from the XPG getsid(2),
* which is defined to return the process group ID of the session
* leader. Insetead, Linux returns the pointer to the session.
*/
pid = (pid_t)SCARG(uap, pid);
if (pid == 0) {
retval[0] = (register_t)p->p_session;
return 0;
}
p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
retval[0] = (register_t)p1->p_session;
return 0;
}
int
linux_sys___sysctl(p, v, retval)
struct proc *p;

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_pipe.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/* $NetBSD: linux_pipe.c,v 1.38 1998/02/20 18:09:04 mycroft Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@ -1139,39 +1139,6 @@ linux_sys_setregid(p, v, retval)
return sys_setregid(p, &bsa, retval);
}
int
linux_sys_getsid(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
struct linux_sys_getsid_args /* {
syscallarg(int) pid;
} */ *uap = v;
struct proc *p1;
pid_t pid;
/*
* NOTE: The Linux getsid(2) is different from the XPG getsid(2),
* which is defined to return the process group ID of the session
* leader. Insetead, Linux returns the pointer to the session.
*/
pid = (pid_t)SCARG(uap, pid);
if (pid == 0) {
retval[0] = (register_t)p->p_session;
return 0;
}
p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
retval[0] = (register_t)p1->p_session;
return 0;
}
int
linux_sys___sysctl(p, v, retval)
struct proc *p;

View File

@ -1,4 +1,4 @@
$NetBSD: syscalls.master,v 1.22 1998/02/19 00:41:12 thorpej Exp $
$NetBSD: syscalls.master,v 1.23 1998/02/20 18:09:04 mycroft Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@ -238,7 +238,7 @@
u_int iovcnt); }
146 NOARGS { int sys_writev(int fd, struct iovec *iovp, \
u_int iovcnt); }
147 STD { int linux_sys_getsid(int pid); }
147 NOARGS { pid_t sys_getsid(pid_t pid); }
148 STD { int linux_sys_fdatasync(int fd); }
149 STD { int linux_sys___sysctl(struct linux___sysctl *lsp); }
150 NOARGS { int sys_mlock(caddr_t addr, size_t len); }