diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2000-09-12 17:30:46 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2000-09-12 17:30:46 +0000 |
commit | 9f1193e30b5f04af9ea81c644eec79b7b535b890 (patch) | |
tree | 8727312b8cad423db40ebc02b0881e80375164ac /lib/libc/sys | |
parent | b33e9e3819325bfe631849e46341ca1d255843b3 (diff) |
o add missing getsid() prototype
o fix typo in getsid() that broke getsid(pid) where pid != 0
o cause getsid() and getpgid() to return EPERM if requesting the
id of a session/process group not in the current session
o check for NULL session in getsid() for exiting processes
Diffstat (limited to 'lib/libc/sys')
-rw-r--r-- | lib/libc/sys/getpgrp.2 | 16 | ||||
-rw-r--r-- | lib/libc/sys/getsid.2 | 9 |
2 files changed, 20 insertions, 5 deletions
diff --git a/lib/libc/sys/getpgrp.2 b/lib/libc/sys/getpgrp.2 index 7ad5ef3799b..e278dcd070d 100644 --- a/lib/libc/sys/getpgrp.2 +++ b/lib/libc/sys/getpgrp.2 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getpgrp.2,v 1.6 1999/07/04 18:59:43 aaron Exp $ +.\" $OpenBSD: getpgrp.2,v 1.7 2000/09/12 17:30:45 millert Exp $ .\" $NetBSD: getpgrp.2,v 1.8 1995/02/27 12:33:09 cgd Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 @@ -71,6 +71,20 @@ and .Fn tcsetpgrp calls are used to get/set the process group of the control terminal. +.Sh ERRORS +.Fn getpgrp +always succeeds, however +.Fn getpgid +will succeed unless: +.Bl -tag -width Er +.It Bq Er EPERM +if the current process and the process +.Fa pid +are not in the same session. +.It Bq Er ESRCH +if there is no process with a process ID equal to +.Fa pid . +.El .Sh SEE ALSO .Xr setpgid 2 , .Xr termios 4 diff --git a/lib/libc/sys/getsid.2 b/lib/libc/sys/getsid.2 index 6d0497876d6..31a66c93e5e 100644 --- a/lib/libc/sys/getsid.2 +++ b/lib/libc/sys/getsid.2 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getsid.2,v 1.7 2000/03/01 17:31:23 todd Exp $ +.\" $OpenBSD: getsid.2,v 1.8 2000/09/12 17:30:45 millert Exp $ .\" .\" Copyright (c) 1997 Peter Wemm <peter@freebsd.org> .\" @@ -56,13 +56,14 @@ to indicate an error. .Fn getsid will succeed unless: .Bl -tag -width Er +.It Bq Er EPERM +if the current process and the process +.Fa pid +are not in the same session. .It Bq Er ESRCH if there is no process with a process ID equal to .Fa pid . .El -.Pp -Note that an implementation may restrict this function call to -processes within the same session ID as the calling process. .Sh SEE ALSO .Xr getpgid 2 , .Xr getpgrp 2 , |