9103 opengroup acknowledgement should be properly formatted in man pages
[unleashed.git] / usr / src / man / man3c / tcsetpgrp.3c
bloba0be04d22adc408439c8832ca2930114e987d37f
1 .\"
2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
6 .\"
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
9 .\" documentation.
10 .\"
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
13 .\"
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group.  In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document.  The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
24 .\"
25 .\" This notice shall appear on any product containing this material.
26 .\"
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
30 .\"
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
35 .\"
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
41 .\"
42 .\"
43 .\" Copyright 1989 AT&T
44 .\" Portions Copyright (c) 1992, X/Open Company Limited  All Rights Reserved
45 .\" Copyright (c) 2002, Sun Microsystems, Inc.  All Rights Reserved.
46 .\"
47 .TH TCSETPGRP 3C "Aug 14, 2002"
48 .SH NAME
49 tcsetpgrp \- set foreground process group ID
50 .SH SYNOPSIS
51 .LP
52 .nf
53 #include <sys/types.h>
54 #include <unistd.h>
56 \fBint\fR \fBtcsetpgrp\fR(\fBint\fR \fIfildes\fR, \fBpid_t\fR \fIpgid_id\fR);
57 .fi
59 .SH DESCRIPTION
60 .sp
61 .LP
62 If the process has a controlling terminal, \fBtcsetpgrp()\fR will set the
63 foreground process group \fBID\fR associated with the terminal to
64 \fIpgid_id\fR. The file associated with \fIfildes\fR must be the controlling
65 terminal of the calling process and the controlling terminal must be currently
66 associated with the session of the calling process. The value of \fIpgid_id\fR
67 must match a process group \fBID\fR of a process in the same session as the
68 calling process.
69 .SH RETURN VALUES
70 .sp
71 .LP
72 Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is
73 returned and \fBerrno\fR is set to indicate the error.
74 .SH ERRORS
75 .sp
76 .LP
77 The \fBtcsetpgrp()\fR function will fail if:
78 .sp
79 .ne 2
80 .na
81 \fB\fBEBADF\fR\fR
82 .ad
83 .RS 10n
84 The \fIfildes\fR argument is not a valid file descriptor.
85 .RE
87 .sp
88 .ne 2
89 .na
90 \fB\fBEINVAL\fR\fR
91 .ad
92 .RS 10n
93 This implementation does not support the value in the \fIpgid_id\fR argument.
94 .RE
96 .sp
97 .ne 2
98 .na
99 \fB\fBENOTTY\fR\fR
101 .RS 10n
102 The calling process does not have a controlling terminal, or the file is not
103 the controlling terminal, or the controlling terminal is no longer associated
104 with the session of the calling process.
108 .ne 2
110 \fB\fBEIO\fR\fR
112 .RS 10n
113 The process is not ignoring or holding \fBSIGTTOU\fR and is a member of an
114 orphaned process group.
118 .ne 2
120 \fB\fBEPERM\fR\fR
122 .RS 10n
123 The value of \fIpgid_id\fR does not match the process group \fBID\fR of a
124 process in the same session as the calling process.
127 .SH ATTRIBUTES
130 See \fBattributes\fR(5) for descriptions of the following attributes:
135 box;
136 c | c
137 l | l .
138 ATTRIBUTE TYPE  ATTRIBUTE VALUE
140 Interface Stability     Standard
142 MT-Level        MT-Safe, and Async-Signal-Safe
145 .SH SEE ALSO
148 \fBtcgetpgrp\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5), \fBtermio\fR(7I)