Imported tab->space correction by redhat
[infodrom/manpages-de] / man2 / setpgid.2
1 .\" Copyright (c) 1983, 1991 Regents of the University of California.
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by the University of
15 .\"     California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)getpgrp.2   6.4 (Berkeley) 3/10/91
33 .\"
34 .\" Modified Sat Jul 24 01:15:33 1993 by Rik Faith (faith@cs.unc.edu)
35 .\" Modified 15 April 1995 by Michael Chastain (mec@shell.portal.com):
36 .\"   Added 'getpgid'.
37 .\" Translated to German Sun Oct 13 1996 by Patrick Rother <krd@gulu.net>
38 .\"
39 .TH SETPGID 2 "13. Oktober 1996" "Linux 1.2.4" "Systemaufrufe"
40 .SH NAME
41 setpgid, getpgid, setpgrp, getpgrp \- setze/hole Prozessgruppe
42 .SH ÜBERSICHT
43 .B #include <unistd.h>
44 .sp
45 .BI "int setpgid(pid_t " pid ", pid_t " pgid );
46 .br
47 .BI "pid_t getpgid(pid_t " pid );
48 .br
49 .B int setpgrp(void);
50 .br
51 .B pid_t getpgrp(void);
52 .SH BESCHREIBUNG
53 .B setpgid
54 setzt die Prozessgruppenkennung (Process Group ID) des durch
55 .I pid
56 angegebenen Prozesses auf
57 .IR pgid .
58 Wenn
59 .I pid
60 Null ist wird die aktuelle Prozesskennung benutzt.  Wenn
61 .I pgid
62 Null ist wird die Prozesskennung des durch
63 .I pid
64 angegebenen Prozesses benutzt.
65
66 .B getpgid
67 gibt die Prozessgruppenkennung des Prozesses zurück, der durch
68 .IR pid
69 angegeben ist.
70 Wenn 
71 .I pid
72 Null ist, wird die Prozesskennung des aktuellen Prozesses benutzt.
73
74 In der Bibliothek Linux DLL 4.4.1 ruft
75 .B setpgrp
76 einfach
77 .BR setpgid(0,0)
78 auf.
79
80 .B getpgrp
81 ist äquivalent zu
82 .BR getpgid(0) .
83
84 Prozessgruppen werden benutzt zur Verbreitung von Signalen und von Terminals
85 zum Verteilen von Eingabeanforderungen: Prozesses, die die gleiche
86 Prozessgruppe haben wie das Terminal, sind im Vordergrund und dürfen lesen,
87 während andere mit einem Signal blockiert sind, wenn sie versuchen zu lesen.
88
89 Diese Aufrufe sind werden also benutzt von Programmen wie
90 .BR csh (1),
91 um Prozessgruppen zu erzeugen, um Job-Kontrolle zu realisieren.  Die Aufrufe
92 .B TIOCGPGRP
93 und
94 .BR TIOCSPGRP ,
95 die in 
96 .BR termios (4)
97 beschrieben sind, werden benutzt, um die Prozessgruppe des kontrollierenden
98 Terminals zu lesen/zu setzen.
99 .SH "RÜCKGABEWERT"
100 Bei Erfolg geben
101 .BR setpgid " und " setpgrp
102 Null zurück.  Im Fehlerfall wird \-1 zurückgegeben und
103 .I errno
104 entsprechend gesetzt.
105
106 .B getpgid
107 gibt bei Erfolg eine Prozessgruppe zurück.
108 Im Fehlerfall wird \-1 zurückgegeben und
109 .I errno
110 entsprechend gesetzt.
111
112 .B getpgrp
113 gibt immer die aktuelle Prozessgruppe zurück.
114 .SH FEHLER
115 .TP
116 .B EINVAL
117 .I pgid
118 ist kleiner als 0.
119 .TP
120 .B EPERM
121 Verschiedene Zugriffsrechteprobleme.
122 .TP
123 .B ESRCH
124 .I pid
125 entspricht keinem Prozess.
126 .SH "SIEHE AUCH"
127 .BR getuid (2),
128 .BR setsid (2),
129 .BR tcsetpgrp (3),
130 .BR termios (4).