.\" -*- coding: UTF-8 -*- .\" Copyright (c) 1995 Jim Van Zandt .\" .\" %%%LICENSE_START(GPLv2+_DOC_FULL) .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as .\" published by the Free Software Foundation; either version 2 of .\" the License, or (at your option) any later version. .\" .\" The GNU General Public License's references to "object code" .\" and "executables" are to be interpreted as the output of any .\" document formatting or typesetting system, including .\" intermediate and printed output. .\" .\" This manual is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public .\" License along with this manual; if not, see .\" . .\" %%%LICENSE_END .\" .\" Modified 2001-12-13, Martin Schulze .\" Added ttyname_r, aeb, 2002-07-20 .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH TTYNAME 3 "10 octobre 2019" Linux "Manuel du programmeur Linux" .SH NOM ttyname, ttyname_r \- Obtenir le nom d'un terminal .SH SYNOPSIS .nf \fB#include \fP .PP \fBchar *ttyname(int \fP\fIfd\fP\fB);\fP .PP \fBint ttyname_r(int \fP\fIfd\fP\fB, char *\fP\fItampon\fP\fB, size_t \fP\fIlngtmp\fP\fB);\fP .fi .SH DESCRIPTION La fonction \fBttyname\fP() renvoie un pointeur sur le nom (terminé par un caractère nul) du périphérique terminal associé au descripteur de fichier \fIfd\fP, ou \fBNULL\fP en cas d'erreur (par exemple si \fIfd\fP n'est pas connecté à un terminal). La valeur renvoyée peut pointer vers des données statiques, susceptibles d'être écrasées lors d'un appel ultérieur. La fonction \fBttyname_r\fP() stocke la valeur dans le \fItampon\fP de longueur \fIlngtmp\fP. .SH "VALEUR RENVOYÉE" La fonction \fBttyname\fP() renvoie un pointeur sur le chemin d'accès. En cas d'erreur, elle renvoie \fBNULL\fP et remplit \fIerrno\fP avec le code d'erreur. La fonction \fBttyname_r\fP() renvoie zéro si elle réussit et un code d'erreur si elle échoue. .SH ERREURS .TP \fBEBADF\fP Mauvais descripteur de fichier. .TP .\" glibc commit 15e9a4f378c8607c2ae1aa465436af4321db0e23 \fBENODEV\fP \fIfd\fP refers to a slave pseudoterminal device but the corresponding pathname could not be found (see NOTES). .TP \fBENOTTY\fP \fIfd\fP does not refer to a terminal device. .TP \fBERANGE\fP (\fBttyname_r\fP()) \fIbuflen\fP est trop court pour stocker le chemin d'accès. .SH ATTRIBUTS Pour une explication des termes utilisés dans cette section, consulter \fBattributes\fP(7). .TS allbox; lb lb lb l l l. Interface Attribut Valeur T{ \fBttyname\fP() T} Sécurité des threads MT\-Unsafe race:ttyname T{ \fBttyname_r\fP() T} Sécurité des threads MT\-Safe .TE .SH CONFORMITÉ POSIX.1\-2001, POSIX.1\-2008, 4.2BSD. .SH NOTES A process that keeps a file descriptor that refers to a \fBpts\fP(4) device open when switching to another mount namespace that uses a different \fI/dev/ptmx\fP instance may still accidentally find that a device path of the same name for that file descriptor exists. However, this device path refers to a different device and thus can't be used to access the device that the file descriptor refers to. Calling \fBttyname\fP() or \fBttyname_r\fP() on the file descriptor in the new mount namespace will cause these functions to return NULL and set \fIerrno\fP to \fBENODEV\fP. .SH "VOIR AUSSI" \fBtty\fP(1), \fBfstat\fP(2), \fBctermid\fP(3), \fBisatty\fP(3), \fBpts\fP(4) .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/. .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 . 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 .