.\" -*- coding: UTF-8 -*- .\" Copyright (c) OpenBSD Group .\" All rights reserved. .\" .\" %%%LICENSE_START(BSD_3_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. 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 .\" .\" Converted into a manpage again by Martin Schulze .\" .\" Added -lutil remark, 030718 .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH OPENPTY 3 "15 septembre 2017" GNU "Manuel du programmeur Linux" .SH NOM openpty, login_tty, forkpty \- Fonctions utilitaires pour terminaux (tty) .SH SYNOPSIS .nf \fB#include \fP .PP \fBint openpty(int *\fP\fIamaster\fP\fB, int *\fP\fIaslave\fP\fB, char *\fP\fIname\fP\fB,\fP \fB const struct termios *\fP\fItermp\fP\fB,\fP \fB const struct winsize *\fP\fIwinp\fP\fB);\fP .PP \fBpid_t forkpty(int *\fP\fIamaster\fP\fB, char *\fP\fIname\fP\fB,\fP \fB const struct termios *\fP\fItermp\fP\fB,\fP \fB const struct winsize *\fP\fIwinp\fP\fB);\fP \fB#include \fP .PP \fBint login_tty(int \fP\fIfd\fP\fB);\fP .PP Effectuez l'édition des liens avec l'option \fI\-lutil\fP. .fi .SH DESCRIPTION La fonction \fBopenpty\fP() localise un pseudoterminal disponible et renvoie des descripteurs de fichier pour le maître et l'esclave dans \fIamaster\fP et \fIaslave\fP. Si la chaîne \fIname\fP ne vaut pas NULL, le nom de fichier de l'esclave est renvoyé dans \fIname\fP. Si \fItermp\fP ne vaut pas NULL, les paramètres du terminal esclave seront affectés conformément aux valeurs spécifiées dans \fItermp\fP. Si \fIwinp\fP ne vaut pas NULL, la taille de la fenêtre de l'esclave sera conditionnée par les valeurs contenues dans \fIwinp\fP. .PP The \fBlogin_tty\fP() function prepares for a login on the terminal referred to by the file descriptor \fIfd\fP (which may be a real terminal device, or the slave of a pseudoterminal as returned by \fBopenpty\fP()) by creating a new session, making \fIfd\fP the controlling terminal for the calling process, setting \fIfd\fP to be the standard input, output, and error streams of the current process, and closing \fIfd\fP. .PP The \fBforkpty\fP() function combines \fBopenpty\fP(), \fBfork\fP(2), and \fBlogin_tty\fP() to create a new process operating in a pseudoterminal. A file descriptor referring to master side of the pseudoterminal is returned in \fIamaster\fP. If \fIname\fP is not NULL, the buffer it points to is used to return the filename of the slave. The \fItermp\fP and \fIwinp\fP arguments, if not NULL, will determine the terminal attributes and window size of the slave side of the pseudoterminal. .SH "VALEUR RENVOYÉE" Lorsqu'un appel à \fBopenpty\fP(), \fBlogin_tty\fP() ou \fBforkpty\fP() échoue, alors, \-1 est renvoyé et \fIerrno\fP est positionnée afin de préciser l'erreur. Sinon \fBopenpty\fP(), \fBlogin_tty\fP(), ainsi que le processus fils de \fBforkpty\fP() renvoient 0 tandis que le processus père de \fBforkpty\fP() renvoie le PID du processus fils. .SH ERREURS \fBopenpty\fP() fails if: .TP \fBENOENT\fP Il n'y a plus de terminaux disponibles. .PP \fBlogin_tty\fP() fails if \fBioctl\fP(2) fails to set \fIfd\fP to the controlling terminal of the calling process. .PP \fBforkpty\fP() fails if either \fBopenpty\fP() or \fBfork\fP(2) fails. .SH ATTRIBUTS Pour une explication des termes utilisés dans cette section, consulter \fBattributes\fP(7). .TS allbox; lbw20 lb lb l l l. Interface Attribut Valeur T{ \fBforkpty\fP(), \fBopenpty\fP() T} Sécurité des threads MT\-Safe locale T{ \fBlogin_tty\fP() T} Sécurité des threads MT\-Unsafe race:ttyname .TE .sp 1 .SH CONFORMITÉ These are BSD functions, present in glibc. They are not standardized in POSIX. .SH NOTES Les modificateurs \fBconst\fP ont été ajoutés dans la glibc 2.8 aux arguments des fonctions \fBopenpty\fP() et \fBforkpty\fP() qui sont des pointeurs sur des structures. .PP Avec les versions de la glibc antérieures à 2.0.92, \fBopenpty\fP() renvoie des descripteurs de fichier pour une paire de pseudoterminaux BSD\ ; depuis glibc 2.0.92, elle essaie d'abord d'ouvrir une paire de pseudoterminaux UNIX 98, et se rabat sur des pseudoterminaux BSD en cas d'échec. .SH BOGUES Personne ne sait combien d'espace il faut réserver pour \fIname\fP, ainsi les appels \fBopenpty\fP() et \fBforkpty\fP() avec un argument \fIname\fP non nul peuvent poser un problème de sécurité. .SH "VOIR AUSSI" \fBfork\fP(2), \fBttyname\fP(3), \fBpty\fP(7) .SH COLOPHON Cette page fait partie de la publication\ 5.10 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/. .PP .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 et David Prévot . .PP 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. .PP 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 .