.\" -*- coding: UTF-8 -*- '\" t .\" Copyright (c) 1995 Jim Van Zandt .\" .\" SPDX-License-Identifier: GPL-2.0-or-later .\" .\" 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 "20 ​​Julio 2023" "Páginas de manual de Linux 6.05.01" .SH NOMBRE ttyname, ttyname_r \- devuelven el nombre de una terminal .SH BIBLIOTECA Biblioteca Estándar C (\fIlibc\fP, \fI\-lc\fP) .SH SINOPSIS .nf \fB#include \fP .PP \fBchar *ttyname(int \fP\fIfd\fP\fB);\fP \fBint ttyname_r(int \fP\fIfd\fP\fB, char \fP\fIbuf\fP\fB[.\fP\fIbuflen\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" The function \fBttyname\fP() returns a pointer to a pathname on success. On error, NULL is returned, and \fIerrno\fP is set to indicate the error. The function \fBttyname_r\fP() returns 0 on success, and an error number upon 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; lbx lb lb l l l. Interfaz Atributo Valor T{ .na .nh \fBttyname\fP() T} Seguridad del hilo MT\-Unsafe race:ttyname T{ .na .nh \fBttyname_r\fP() T} Seguridad del hilo Multi\-hilo seguro .TE .sp 1 .SH ESTÁNDARES POSIX.1\-2008. .SH HISTORIAL POSIX.1\-2001, 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) .PP .SH TRADUCCIÓN La traducción al español de esta página del manual fue creada por Miguel Pérez Ibars . .PP 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. .PP 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 .