.\" -*- coding: UTF-8 -*- .\" Copyright (c) 1983, 1991 Regents of the University of California. .\" and Copyright (C) 2007, Michael Kerrisk .\" All rights reserved. .\" .\" %%%LICENSE_START(BSD_4_CLAUSE_UCB) .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the University of .\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" %%%LICENSE_END .\" .\" @(#)getpgrp.2 6.4 (Berkeley) 3/10/91 .\" .\" Modified 1993-07-24 by Rik Faith .\" Modified 1995-04-15 by Michael Chastain : .\" Added 'getpgid'. .\" Modified 1996-07-21 by Andries Brouwer .\" Modified 1996-11-06 by Eric S. Raymond .\" Modified 1999-09-02 by Michael Haardt .\" Modified 2002-01-18 by Michael Kerrisk .\" Modified 2003-01-20 by Andries Brouwer .\" 2007-07-25, mtk, fairly substantial rewrites and rearrangements .\" of text. .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH SETPGID 2 "15 septembre 2017" Linux "Manuel du programmeur Linux" .SH NOM setpgid, getpgid, setpgrp, getpgrp \- Définir ou lire le groupe du processus .SH SYNOPSIS \fB#include \fP .br \fB#include \fP .PP \fBint setpgid(pid_t \fP\fIpid\fP\fB, pid_t \fP\fIpgid\fP\fB);\fP .br \fBpid_t getpgid(pid_t \fP\fIpid\fP\fB);\fP .PP \fBpid_t getpgrp(void);\fP /* version POSIX.1 */ .br \fBpid_t getpgrp(pid_t \fP\fIpid\fP\fB);\ \ \ \ \ \ \ \ \ \ \ \fP /* version BSD */ .PP \fBint setpgrp(void);\fP /* version System\ V */ .br \fBint setpgrp(pid_t \fP\fIpid\fP\fB, pid_t \fP\fIpgid\fP\fB);\fP /* version BSD */ .PP .in -4n Exigences de macros de test de fonctionnalités pour la glibc (consulter \fBfeature_test_macros\fP(7))\ : .in .PP .ad l \fBgetpgid\fP()\ : .RS 4 .\" || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED _XOPEN_SOURCE\ >=\ 500 .br || /* Since glibc 2.12: */ _POSIX_C_SOURCE\ >=\ 200809L .RE .PP \fBsetpgrp\fP() (POSIX.1)\ : .nf .\" || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED _XOPEN_SOURCE\ >=\ 500 || /* Since glibc 2.19: */ _DEFAULT_SOURCE || /* Glibc versions <= 2.19: */ _SVID_SOURCE .fi .PP \fBsetpgrp\fP()\ (BSD), \fBgetpgrp\fP()\ (BSD): .nf [These are available only before glibc 2.19] _BSD_SOURCE && !\ (_POSIX_SOURCE || _POSIX_C_SOURCE || _XOPEN_SOURCE || _GNU_SOURCE || _SVID_SOURCE) .fi .ad .SH DESCRIPTION Toutes ces interfaces sont disponibles sous Linux et sont utilisées pour récupérer et définir l'identifiant du groupe de processus (PGID\ : «\ Process Group ID\ ») d'un processus. La façon préférée, celle spécifiée par POSIX.1 est\ : \fBgetpgrp\fP(void) pour récupérer le PGID du processus appelant et \fBsetpgid\fP() pour définir le PGID d'un processus. .PP \fBsetpgid\fP() définit à \fIpgid\fP le PGID du processus mentionné par \fIpid\fP. Si \fIpid\fP vaut zéro, alors le PID du processus appelant est utilisé. Si \fIpgid\fP vaut zéro, alors le PGID du processus indiqué par \fIpid\fP est positionné à la même valeur que l'identifiant du processus. Si \fBsetpgid\fP est utilisé pour déplacer un processus d'un groupe dans un autre (comme cela peut être fait par certains shell pour les pipelines), les deux groupes de processus doivent appartenir à la même session (consultez \fBsetsid\fP(2) et \fBcredentials\fP(7)). Dans ce cas, \fIpgid\fP indique un groupe de processus existant à rejoindre et l'ID de session de ce groupe doit être celui du processus concerné. .PP La version POSIX.1 de \fBgetpgrp\fP(), qui ne prend pas de paramètre, renvoie le PGID du processus appelant. .PP \fBgetpgid\fP() renvoie le PGID du processus indiqué par \fIpid\fP. Si \fIpid\fP vaut zéro, le PID du processus appelant est utilisé. La récupération du PGID d'un processus autre que l'appelant est rarement utilisée et \fBgetpgrp\fP() est préférée pour cette tâche. .PP L'appel \fBsetpgrp\fP() de System\ V, qui ne prend pas de paramètre, est équivalent à \fIsetpgid(0,\ 0)\fP. .PP The BSD\-specific \fBsetpgrp\fP() call, which takes arguments \fIpid\fP and \fIpgid\fP, is a wrapper function that calls .PP setpgid(pid, pgid) .PP .\" The true BSD setpgrp() system call differs in allowing the PGID .\" to be set to arbitrary values, rather than being restricted to .\" PGIDs in the same session. A partir de glibc 2.19, la fonction spécifique à BSD \fBsetpgrp\fP() ne figure plus dans \fI\fP\ ; les appels à cette fonction doivent être remplacés par des appels à \fBsetpgid\fP() tel qu'indiqué précédemment. .PP L'appel \fBgetpgrp\fP() spécifique à BSD qui prend un unique paramètre \fIpid\fP est une fonction d'encapsulation de .PP getpgid(pid) .PP A partir de glibc 2.19, la fonction spécifique à BSD \fBgetpgrp\fP() ne figure plus dans \fI\fP\ ; les appels à cette fonction doivent être remplacés par des appels à la fonction POSIX.1 \fBgetpgrp\fP() qui ne prend pas d'argument (si l'appel a pour objet de récupérer le PGID du processus appelant), ou par des appels à \fBgetpgid\fP() tel que décrit précédemment. .SH "VALEUR RENVOYÉE" \fBsetpgid\fP() et \fBsetpgrp\fP() renvoient zéro s'ils réussissent, ou \-1 s'ils échouent, auquel cas \fIerrno\fP contient le code d'erreur. .PP L'appel \fBgetpgrp\fP() de POSIX.1 renvoie le PGID du processus appelant. .PP \fBgetpgid\fP() et l'appel spécifique à BSD \fBgetpgrp\fP() renvoient le groupe du processus s'il réussit. En cas d'erreur \-1 est renvoyé et \fIerrno\fP contient le code d'erreur. .SH ERREURS .TP \fBEACCES\fP On a essayé de changer le groupe de processus d'un enfant du processus appelant, et ce fils a déjà effectué un \fBexecve\fP(2) (\fBsetpgid\fP(), \fBsetpgrp\fP()). .TP \fBEINVAL\fP \fIpgid\fP est inférieur à 0 (\fBsetpgid\fP(), \fBsetpgrp\fP()). .TP \fBEPERM\fP On a essayé de déplacer un processus dans un groupe d'une session différente, ou de changer le groupe d'un fils du processus appelant qui se trouve dans une autre session, ou de modifier le groupe d'un leader de session (\fBsetpgid\fP(), \fBsetpgrp\fP()). .TP \fBESRCH\fP Pour \fBgetpgid\fP()\ : \fIpid\fP ne correspond à aucun processus. Pour \fBsetpgid\fP()\ : \fIpid\fP n'est ni le processus appelant, ni l'un de ses enfants. .SH CONFORMITÉ \fBsetpgid\fP() et la version de \fBgetpgrp\fP() sans paramètre sont conformes à POSIX.1\-2001. .PP POSIX.1\-2001 spécifie également \fBgetpgid\fP() et la version de \fBsetpgrp\fP() qui ne prend pas de paramètre. (POSIX.1\-2008 marque cette spécification de \fBsetpgrp\fP() comme obsolète) .PP La version de \fBgetpgrp\fP() avec un paramètre et la version de \fBsetpgrp\fP() qui prend deux paramètres provient de BSD\ 4.2 et ne sont pas spécifiées par POSIX.1. .SH NOTES Un processus fils créé par \fBfork\fP(2) hérite du PGID de son père. Le PGID est conservé au travers d'un \fBexecve\fP(2). .PP Each process group is a member of a session and each process is a member of the session of which its process group is a member. (See \fBcredentials\fP(7).) .PP Une session peut avoir un terminal de contrôle. À tout moment, un (et un seul) des groupes de processus de cette session peut être le groupe de premier plan du terminal\ ; les autre groupes de processus sont en arrière plan. Si un signal est généré depuis le terminal (par exemple une touche d'interruption pour générer un \fBSIGINT\fP), ce signal est envoyé au groupe de processus au premier plan. Consultez \fBtermios\fP(3) pour la liste des caractères qui génèrent des signaux. Seul le groupe de processus au premier plan peut lire avec \fBread\fP(2) sur le terminal\ ; si un groupe de processus essaie de lire avec \fBread\fP(2) sur le terminal, alors le groupe reçoit un signal \fBSIGTTIN\fP, qui le suspend. Les fonctions \fBtcgetpgrp\fP(3) et \fBtcsetpgrp\fP(3) sont utilisées pour récupérer ou positionner le groupe de processus au premier plan du terminal de contrôle. .PP Les appels \fBsetpgid\fP() et \fBgetpgrp\fP() sont utilisés par des programmes comme \fBbash\fP(1) pour créer des groupes de processus pour l'implémentation du contrôle des travaux depuis l'interpréteur de commande. .PP .\" exit.3 refers to the following text: If the termination of a process causes a process group to become orphaned, and if any member of the newly orphaned process group is stopped, then a \fBSIGHUP\fP signal followed by a \fBSIGCONT\fP signal will be sent to each process in the newly orphaned process group. An orphaned process group is one in which the parent of every member of process group is either itself also a member of the process group or is a member of a process group in a different session (see also \fBcredentials\fP(7)). .SH "VOIR AUSSI" \fBgetuid\fP(2), \fBsetsid\fP(2), \fBtcgetpgrp\fP(3), \fBtcsetpgrp\fP(3), \fBtermios\fP(3), \fBcredentials\fP(7) .SH COLOPHON Cette page fait partie de la publication\ 5.04 du projet \fIman\-pages\fP Linux. Une description du projet et des instructions pour signaler des anomalies et la dernière version de cette page peuvent être trouvées à l'adresse \%https://www.kernel.org/doc/man\-pages/. .SH TRADUCTION La traduction française de cette page de manuel a été créée par Christophe Blaess , Stéphan Rafin , Thierry Vignaud , François Micaux, Alain Portal , Jean-Philippe Guérard , Jean-Luc Coulon (f5ibh) , Julien Cristau , Thomas Huriaux , Nicolas François , Florentin Duneau , Simon Paillard , Denis Barbier , David Prévot , Cédric Boutillier et Frédéric Hantrais . Cette traduction est une documentation libre ; veuillez vous reporter à la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License version 3 .UE concernant les conditions de copie et de distribution. Il n'y a aucune RESPONSABILITÉ LÉGALE. Si vous découvrez un bogue dans la traduction de cette page de manuel, veuillez envoyer un message à .MT debian-l10n-french@lists.debian.org .ME .