File: tcgetpgrp.3

package info (click to toggle)
manpages-fr 1.58.1-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 10,104 kB
  • ctags: 4
  • sloc: makefile: 106; sh: 8
file content (113 lines) | stat: -rw-r--r-- 3,581 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
.\" Copyright (C) 2002 Andries Brouwer <aeb@cwi.nl>
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one
.\" 
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date.  The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein.  The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\" 
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\" Traduction Christophe Blaess <ccb@club-internet.fr>
.\" MJ 21/07/2003 LDP-1.57
.TH TCGETPGRP 3 "21 juillet 2003" LDP "Manuel du programmeur Linux"
.SH NOM
tcgetpgrp, tcsetpgrp \- Lire/crire le processus d'avant-plan d'un terminal.
.SH SYNOPSIS
.sp
.BR "#include <unistd.h>"
.sp
.BI "pid_t tcgetpgrp(int " fd );
.sp
.BI "int tcsetpgrp(int " fd ", pid_t " pgrp );
.SH DESCRIPTION
La fonction
.B tcgetpgrp()
renvoie l'ID du groupe de processus  l'avant-plan sur le terminal
associ
.IR fd ,
qui doit tre le terminal de contrle du processus appelant.
.\" The process itself may be a background process.
.LP
La fonction
.B tcsetpgrp()
fait du groupe de procesus \fIpgrp\fP le groupe en avant-plan
sur le terminal associ 
.IR fd ,
qui doit tre le terminal de contrle du processus appelant,
et tre toujours associ  sa session.
En outre, \fIpgrp\fP doit tre un groupe (non vide) de processus appartenant
 la mme session que le processus appelant.
.LP
Si
.B tcsetpgrp()
est appel par un membe d'un groupe de processus en arrire plan dans sa session,
et si le processus appelant ne bloque ni n'ignore SIGTTOU,
une signal SIGTTOU est envoy  tous les membre du groupe en arrire-plan.
.SH "VALEUR RENVOYE"
Quand
.I fd
identifie le terminal de contrle du processus appelant,
la fonction
.B tcgetpgrp()
renverra l'ID du groupe de processus en avant-plan sur ce terminal s'il y en a,
et une valeur suprieure  1 autre qu'un ID de groupe de
processus existant sinon.
Si
.I fd
ne correspon pas au terminal de contrle du processus,
\-1 est renvoy et
.I errno
est rempli.
.LP
Lorqu'elle russit, la fonction
.B tcsetpgrp()
renvoie 0. Sinon, elle renvoie \-1, et remplit
.I errno
avec le code d'erreur.
.SH ERREURS
.TP
.B EBADF
.I fd
n'est pas un descripteur valide.
.TP
.B EINVAL
.I pgrp
a une valeur illgale.
.TP
.B EPERM
.I pgrp
a une valeur lgale, mais ce n'est pas l'ID d'un groupe de processus
dans la mme session que le processus appelant.
.TP
.B ENOTTY
Le processus appelant n'a pas de terminal de contrle, ou
il en a un mais ce n'est pas celui dcrit par
.IR fd ,
ou, pour
.BR tcsetpgrp() ,
ce terminal de contrle n'est plus associ avec la session du processus
appelant.
.SH NOTES
Ces fonctions sont implmentes via les ioctls TIOCGPGRP et
TIOCSPGRP.
.SH HISTORIQUE
Les ioctls sont apparus dans 4.2 BSD. Ces fonctions sont des inventions POSIX.
.SH "CONFORMIT"
POSIX.1
.SH "VOIR AUSSI"
.BR setpgid (2),
.BR setsid (2)
.SH TRADUCTION
Christophe Blaess, 2003.