.\" -*- 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 Octubre 2019" Linux "Manual del Programador de Linux" .SH NOMBRE ttyname, ttyname_r \- devuelven el nombre de una terminal .SH SINOPSIS .nf \fB#include \fP .PP \fBchar *ttyname(int \fP\fIfd\fP\fB);\fP .PP \fBint ttyname_r(int \fP\fIfd\fP\fB, char *\fP\fIbuf\fP\fB, size_t \fP\fIbuflen\fP\fB);\fP .fi .SH DESCRIPCIÓN The function \fBttyname\fP() returns a pointer to the null\-terminated pathname of the terminal device that is open on the file descriptor \fIfd\fP, or NULL on error (for example, if \fIfd\fP is not connected to a terminal). The return value may point to static data, possibly overwritten by the next call. The function \fBttyname_r\fP() stores this pathname in the buffer \fIbuf\fP of length \fIbuflen\fP. .SH "VALOR DEVUELTO" La función \fBttyname\fP() devuelve un puntero a un nombre de ruta en caso de éxito. En caso de error, devuelve NULL, y modifica \fIerrno\fP con el valor apropiado. La función \fBttyname_r\fP() devuelve 0 en caso de éxito, y un número de error si sucede un error. .SH ERRORES .TP \fBEBADF\fP Descriptor de fichero incorrecto. .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 no hace referencia a un dispositivo terminal. .TP \fBERANGE\fP (\fBttyname_r\fP()) \fIbuflen\fP es demasiado pequeño para permitir el almacenamiento del nombre de ruta. .SH ATRIBUTOS Para obtener una explicación de los términos usados en esta sección, véase \fBattributes\fP(7). .TS allbox; lb lb lb l l l. Interfaz Atributo Valor T{ \fBttyname\fP() T} Seguridad del hilo MT\-Unsafe race:ttyname T{ \fBttyname_r\fP() T} Seguridad del hilo Multi\-hilo seguro .TE .SH "CONFORME A" POSIX.1\-2001, POSIX.1\-2008, 4.2BSD. .SH NOTAS 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 "VÉASE TAMBIÉN" \fBtty\fP(1), \fBfstat\fP(2), \fBctermid\fP(3), \fBisatty\fP(3), \fBpts\fP(4) .SH COLOFÓN Esta página es parte de la versión 5.10 del proyecto Linux \fIman\-pages\fP. Puede encontrar una descripción del proyecto, información sobre cómo informar errores y la última versión de esta página en \%https://www.kernel.org/doc/man\-pages/. .SH TRADUCCIÓN La traducción al español de esta página del manual fue creada por Miguel Pérez Ibars . Esta traducción es documentación libre; lea la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3 .UE o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD. Si encuentra algún error en la traducción de esta página del manual, envíe un correo electrónico a .MT debian-l10n-spanish@lists.debian.org>. .ME .