summaryrefslogtreecommitdiff
path: root/sys/compat/linux
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>1998-02-14 01:28:15 +0000
committerthorpej <thorpej@NetBSD.org>1998-02-14 01:28:15 +0000
commit821a4fec46202a7d7ca90404ec2e3f42fca5bc59 (patch)
tree418f68a2d9f41809c7469bdad3b4c88661ec0a7d /sys/compat/linux
parentc1538fb038809c96e81c3f9a2668a6310b842a0f (diff)
Add a comment clearly describing that Linux's getsid(2) differs from
the XPG4.2 definition in that it returns the kernel virtual address of the session structure, rather than the process group ID of the session leader.
Diffstat (limited to 'sys/compat/linux')
-rw-r--r--sys/compat/linux/common/linux_break.c14
-rw-r--r--sys/compat/linux/common/linux_misc.c14
-rw-r--r--sys/compat/linux/common/linux_misc_notalpha.c14
-rw-r--r--sys/compat/linux/common/linux_oldmmap.c14
-rw-r--r--sys/compat/linux/common/linux_oldolduname.c14
-rw-r--r--sys/compat/linux/common/linux_oldselect.c14
-rw-r--r--sys/compat/linux/common/linux_olduname.c14
-rw-r--r--sys/compat/linux/common/linux_pipe.c14
-rw-r--r--sys/compat/linux/linux_misc.c14
-rw-r--r--sys/compat/linux/multiarch/linux_break.c14
-rw-r--r--sys/compat/linux/multiarch/linux_misc_notalpha.c14
-rw-r--r--sys/compat/linux/multiarch/linux_oldmmap.c14
-rw-r--r--sys/compat/linux/multiarch/linux_oldolduname.c14
-rw-r--r--sys/compat/linux/multiarch/linux_oldselect.c14
-rw-r--r--sys/compat/linux/multiarch/linux_olduname.c14
-rw-r--r--sys/compat/linux/multiarch/linux_pipe.c14
16 files changed, 160 insertions, 64 deletions
diff --git a/sys/compat/linux/common/linux_break.c b/sys/compat/linux/common/linux_break.c
index 910462a99ee..36e62514b37 100644
--- a/sys/compat/linux/common/linux_break.c
+++ b/sys/compat/linux/common/linux_break.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_break.c,v 1.36 1997/10/21 00:57:38 fvdl Exp $ */
+/* $NetBSD: linux_break.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@@ -1151,18 +1151,24 @@ linux_sys_getsid(p, v, retval)
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] = (int)p->p_session; /* XXX Oh well */
+ retval[0] = (register_t)p->p_session;
return 0;
}
- p1 = pfind((int)pid);
+ p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
- retval[0] = (int)p1->p_session;
+ retval[0] = (register_t)p1->p_session;
return 0;
}
diff --git a/sys/compat/linux/common/linux_misc.c b/sys/compat/linux/common/linux_misc.c
index 3f6127c2d16..07bc27c7ec5 100644
--- a/sys/compat/linux/common/linux_misc.c
+++ b/sys/compat/linux/common/linux_misc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_misc.c,v 1.36 1997/10/21 00:57:38 fvdl Exp $ */
+/* $NetBSD: linux_misc.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@@ -1151,18 +1151,24 @@ linux_sys_getsid(p, v, retval)
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] = (int)p->p_session; /* XXX Oh well */
+ retval[0] = (register_t)p->p_session;
return 0;
}
- p1 = pfind((int)pid);
+ p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
- retval[0] = (int)p1->p_session;
+ retval[0] = (register_t)p1->p_session;
return 0;
}
diff --git a/sys/compat/linux/common/linux_misc_notalpha.c b/sys/compat/linux/common/linux_misc_notalpha.c
index d01595c184f..36e340fa983 100644
--- a/sys/compat/linux/common/linux_misc_notalpha.c
+++ b/sys/compat/linux/common/linux_misc_notalpha.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_misc_notalpha.c,v 1.36 1997/10/21 00:57:38 fvdl Exp $ */
+/* $NetBSD: linux_misc_notalpha.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@@ -1151,18 +1151,24 @@ linux_sys_getsid(p, v, retval)
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] = (int)p->p_session; /* XXX Oh well */
+ retval[0] = (register_t)p->p_session;
return 0;
}
- p1 = pfind((int)pid);
+ p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
- retval[0] = (int)p1->p_session;
+ retval[0] = (register_t)p1->p_session;
return 0;
}
diff --git a/sys/compat/linux/common/linux_oldmmap.c b/sys/compat/linux/common/linux_oldmmap.c
index 8ecfb90b8d2..3199912a8b4 100644
--- a/sys/compat/linux/common/linux_oldmmap.c
+++ b/sys/compat/linux/common/linux_oldmmap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_oldmmap.c,v 1.36 1997/10/21 00:57:38 fvdl Exp $ */
+/* $NetBSD: linux_oldmmap.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@@ -1151,18 +1151,24 @@ linux_sys_getsid(p, v, retval)
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] = (int)p->p_session; /* XXX Oh well */
+ retval[0] = (register_t)p->p_session;
return 0;
}
- p1 = pfind((int)pid);
+ p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
- retval[0] = (int)p1->p_session;
+ retval[0] = (register_t)p1->p_session;
return 0;
}
diff --git a/sys/compat/linux/common/linux_oldolduname.c b/sys/compat/linux/common/linux_oldolduname.c
index da9d0464695..5f5a9c516e7 100644
--- a/sys/compat/linux/common/linux_oldolduname.c
+++ b/sys/compat/linux/common/linux_oldolduname.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_oldolduname.c,v 1.36 1997/10/21 00:57:38 fvdl Exp $ */
+/* $NetBSD: linux_oldolduname.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@@ -1151,18 +1151,24 @@ linux_sys_getsid(p, v, retval)
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] = (int)p->p_session; /* XXX Oh well */
+ retval[0] = (register_t)p->p_session;
return 0;
}
- p1 = pfind((int)pid);
+ p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
- retval[0] = (int)p1->p_session;
+ retval[0] = (register_t)p1->p_session;
return 0;
}
diff --git a/sys/compat/linux/common/linux_oldselect.c b/sys/compat/linux/common/linux_oldselect.c
index fc462e1668b..3ba93822532 100644
--- a/sys/compat/linux/common/linux_oldselect.c
+++ b/sys/compat/linux/common/linux_oldselect.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_oldselect.c,v 1.36 1997/10/21 00:57:38 fvdl Exp $ */
+/* $NetBSD: linux_oldselect.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@@ -1151,18 +1151,24 @@ linux_sys_getsid(p, v, retval)
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] = (int)p->p_session; /* XXX Oh well */
+ retval[0] = (register_t)p->p_session;
return 0;
}
- p1 = pfind((int)pid);
+ p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
- retval[0] = (int)p1->p_session;
+ retval[0] = (register_t)p1->p_session;
return 0;
}
diff --git a/sys/compat/linux/common/linux_olduname.c b/sys/compat/linux/common/linux_olduname.c
index f7e831e0dbc..f892ed21d17 100644
--- a/sys/compat/linux/common/linux_olduname.c
+++ b/sys/compat/linux/common/linux_olduname.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_olduname.c,v 1.36 1997/10/21 00:57:38 fvdl Exp $ */
+/* $NetBSD: linux_olduname.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@@ -1151,18 +1151,24 @@ linux_sys_getsid(p, v, retval)
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] = (int)p->p_session; /* XXX Oh well */
+ retval[0] = (register_t)p->p_session;
return 0;
}
- p1 = pfind((int)pid);
+ p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
- retval[0] = (int)p1->p_session;
+ retval[0] = (register_t)p1->p_session;
return 0;
}
diff --git a/sys/compat/linux/common/linux_pipe.c b/sys/compat/linux/common/linux_pipe.c
index 4c9250ec19b..cf97afaaff9 100644
--- a/sys/compat/linux/common/linux_pipe.c
+++ b/sys/compat/linux/common/linux_pipe.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_pipe.c,v 1.36 1997/10/21 00:57:38 fvdl Exp $ */
+/* $NetBSD: linux_pipe.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@@ -1151,18 +1151,24 @@ linux_sys_getsid(p, v, retval)
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] = (int)p->p_session; /* XXX Oh well */
+ retval[0] = (register_t)p->p_session;
return 0;
}
- p1 = pfind((int)pid);
+ p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
- retval[0] = (int)p1->p_session;
+ retval[0] = (register_t)p1->p_session;
return 0;
}
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index 3f6127c2d16..07bc27c7ec5 100644
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_misc.c,v 1.36 1997/10/21 00:57:38 fvdl Exp $ */
+/* $NetBSD: linux_misc.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@@ -1151,18 +1151,24 @@ linux_sys_getsid(p, v, retval)
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] = (int)p->p_session; /* XXX Oh well */
+ retval[0] = (register_t)p->p_session;
return 0;
}
- p1 = pfind((int)pid);
+ p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
- retval[0] = (int)p1->p_session;
+ retval[0] = (register_t)p1->p_session;
return 0;
}
diff --git a/sys/compat/linux/multiarch/linux_break.c b/sys/compat/linux/multiarch/linux_break.c
index 910462a99ee..36e62514b37 100644
--- a/sys/compat/linux/multiarch/linux_break.c
+++ b/sys/compat/linux/multiarch/linux_break.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_break.c,v 1.36 1997/10/21 00:57:38 fvdl Exp $ */
+/* $NetBSD: linux_break.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@@ -1151,18 +1151,24 @@ linux_sys_getsid(p, v, retval)
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] = (int)p->p_session; /* XXX Oh well */
+ retval[0] = (register_t)p->p_session;
return 0;
}
- p1 = pfind((int)pid);
+ p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
- retval[0] = (int)p1->p_session;
+ retval[0] = (register_t)p1->p_session;
return 0;
}
diff --git a/sys/compat/linux/multiarch/linux_misc_notalpha.c b/sys/compat/linux/multiarch/linux_misc_notalpha.c
index d01595c184f..36e340fa983 100644
--- a/sys/compat/linux/multiarch/linux_misc_notalpha.c
+++ b/sys/compat/linux/multiarch/linux_misc_notalpha.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_misc_notalpha.c,v 1.36 1997/10/21 00:57:38 fvdl Exp $ */
+/* $NetBSD: linux_misc_notalpha.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@@ -1151,18 +1151,24 @@ linux_sys_getsid(p, v, retval)
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] = (int)p->p_session; /* XXX Oh well */
+ retval[0] = (register_t)p->p_session;
return 0;
}
- p1 = pfind((int)pid);
+ p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
- retval[0] = (int)p1->p_session;
+ retval[0] = (register_t)p1->p_session;
return 0;
}
diff --git a/sys/compat/linux/multiarch/linux_oldmmap.c b/sys/compat/linux/multiarch/linux_oldmmap.c
index 8ecfb90b8d2..3199912a8b4 100644
--- a/sys/compat/linux/multiarch/linux_oldmmap.c
+++ b/sys/compat/linux/multiarch/linux_oldmmap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_oldmmap.c,v 1.36 1997/10/21 00:57:38 fvdl Exp $ */
+/* $NetBSD: linux_oldmmap.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@@ -1151,18 +1151,24 @@ linux_sys_getsid(p, v, retval)
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] = (int)p->p_session; /* XXX Oh well */
+ retval[0] = (register_t)p->p_session;
return 0;
}
- p1 = pfind((int)pid);
+ p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
- retval[0] = (int)p1->p_session;
+ retval[0] = (register_t)p1->p_session;
return 0;
}
diff --git a/sys/compat/linux/multiarch/linux_oldolduname.c b/sys/compat/linux/multiarch/linux_oldolduname.c
index da9d0464695..5f5a9c516e7 100644
--- a/sys/compat/linux/multiarch/linux_oldolduname.c
+++ b/sys/compat/linux/multiarch/linux_oldolduname.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_oldolduname.c,v 1.36 1997/10/21 00:57:38 fvdl Exp $ */
+/* $NetBSD: linux_oldolduname.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@@ -1151,18 +1151,24 @@ linux_sys_getsid(p, v, retval)
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] = (int)p->p_session; /* XXX Oh well */
+ retval[0] = (register_t)p->p_session;
return 0;
}
- p1 = pfind((int)pid);
+ p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
- retval[0] = (int)p1->p_session;
+ retval[0] = (register_t)p1->p_session;
return 0;
}
diff --git a/sys/compat/linux/multiarch/linux_oldselect.c b/sys/compat/linux/multiarch/linux_oldselect.c
index fc462e1668b..3ba93822532 100644
--- a/sys/compat/linux/multiarch/linux_oldselect.c
+++ b/sys/compat/linux/multiarch/linux_oldselect.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_oldselect.c,v 1.36 1997/10/21 00:57:38 fvdl Exp $ */
+/* $NetBSD: linux_oldselect.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@@ -1151,18 +1151,24 @@ linux_sys_getsid(p, v, retval)
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] = (int)p->p_session; /* XXX Oh well */
+ retval[0] = (register_t)p->p_session;
return 0;
}
- p1 = pfind((int)pid);
+ p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
- retval[0] = (int)p1->p_session;
+ retval[0] = (register_t)p1->p_session;
return 0;
}
diff --git a/sys/compat/linux/multiarch/linux_olduname.c b/sys/compat/linux/multiarch/linux_olduname.c
index f7e831e0dbc..f892ed21d17 100644
--- a/sys/compat/linux/multiarch/linux_olduname.c
+++ b/sys/compat/linux/multiarch/linux_olduname.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_olduname.c,v 1.36 1997/10/21 00:57:38 fvdl Exp $ */
+/* $NetBSD: linux_olduname.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@@ -1151,18 +1151,24 @@ linux_sys_getsid(p, v, retval)
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] = (int)p->p_session; /* XXX Oh well */
+ retval[0] = (register_t)p->p_session;
return 0;
}
- p1 = pfind((int)pid);
+ p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
- retval[0] = (int)p1->p_session;
+ retval[0] = (register_t)p1->p_session;
return 0;
}
diff --git a/sys/compat/linux/multiarch/linux_pipe.c b/sys/compat/linux/multiarch/linux_pipe.c
index 4c9250ec19b..cf97afaaff9 100644
--- a/sys/compat/linux/multiarch/linux_pipe.c
+++ b/sys/compat/linux/multiarch/linux_pipe.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_pipe.c,v 1.36 1997/10/21 00:57:38 fvdl Exp $ */
+/* $NetBSD: linux_pipe.c,v 1.37 1998/02/14 01:28:15 thorpej Exp $ */
/*
* Copyright (c) 1995 Frank van der Linden
@@ -1151,18 +1151,24 @@ linux_sys_getsid(p, v, retval)
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] = (int)p->p_session; /* XXX Oh well */
+ retval[0] = (register_t)p->p_session;
return 0;
}
- p1 = pfind((int)pid);
+ p1 = pfind(pid);
if (p1 == NULL)
return ESRCH;
- retval[0] = (int)p1->p_session;
+ retval[0] = (register_t)p1->p_session;
return 0;
}