diff options
| author | thorpej <thorpej@NetBSD.org> | 1998-02-14 01:28:15 +0000 |
|---|---|---|
| committer | thorpej <thorpej@NetBSD.org> | 1998-02-14 01:28:15 +0000 |
| commit | 821a4fec46202a7d7ca90404ec2e3f42fca5bc59 (patch) | |
| tree | 418f68a2d9f41809c7469bdad3b4c88661ec0a7d /sys/compat/linux/common/linux_oldselect.c | |
| parent | c1538fb038809c96e81c3f9a2668a6310b842a0f (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/common/linux_oldselect.c')
| -rw-r--r-- | sys/compat/linux/common/linux_oldselect.c | 14 |
1 files changed, 10 insertions, 4 deletions
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; } |
