.\" -*- coding: UTF-8 -*- '\" t .\" Copyright (C) 2002 Andries Brouwer .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" .\" This replaces an earlier man page written by Walter Harms .\" . .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH ttyslot 3 "20 ​​Julio 2023" "Páginas de manual de Linux 6.05.01" .SH NOMBRE ttyslot \- encuentra la posición de la terminal de usuario actual en algún archivo .SH BIBLIOTECA Biblioteca Estándar C (\fIlibc\fP, \fI\-lc\fP) .SH SINOPSIS .nf \fB#include \fP /* Vea NOTAS */ .PP \fBint ttyslot(void);\fP .fi .PP .RS -4 Requisitos de Macros de Prueba de Características para glibc (véase \fBfeature_test_macros\fP(7)): .RE .PP \fBttyslot\fP(): .nf A partir de glibc 2.24: _DEFAULT_SOURCE Desde glibc 2.20 hasta glibc 2.23: _DEFAULT_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500) glibc 2.19 y anteriores: _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500) .fi .SH DESCRIPCIÓN La función histórica \fBttyslot\fP() devuelve el índice de la entrada de usuario actual en algún archivo. .PP Entonces "¿En qué archivo?" se preguntará. Bueno, veamos primero algo de historia. .SS "Historia Antigua" Solía haber un archivo \fI/etc/ttys\fP en UNIX\ V6, que era leído por el programa \fBinit\fP(1) para descubrir qué hacer con cada línea terminal. Cada línea consistía en tres caracteres. El primer carácter podía ser \[aq]0\[aq] o bien \[aq]1\[aq], donde \[aq]0\[aq]' significaba "ignorar". El segundo carácter denotaba la terminal: \[aq]8\[aq] significaba "/dev/tty8". El tercer carácter era un argumento para \fBgetty\fP(8) que indicaba la secuencia de velocidades de línea a probar (\[aq]\-\[aq] era: comienza a probar 110 baudios). De modo que la típica línea era "18\-". Un cuelgue en alguna línea se resolvía cambiando el \[aq]1\[aq] a \[aq]0\[aq], señalando a init, cambiando otra vez, y volviendo a señalar a init de nuevo. .PP In UNIX\ V7 the format was changed: here the second character was the argument to \fBgetty\fP(8) indicating the sequence of line speeds to try (\[aq]0\[aq] was: cycle through 300\-1200\-150\-110 baud; \[aq]4\[aq] was for the on\-line console DECwriter) while the rest of the line contained the name of the tty. Thus a typical line was "14console". .PP Sistemas más modernos tienen sintaxis más elaborada. Los sistemas tipo System\-V tienen \fI/etc/inittab\fP en su lugar. .SS "Historia Antigua (2)" Por otro lado, está el archivo \fI/etc/utmp\fP que listaba las personas que estaban conectadas en ese momento. Es mantenido por \fBlogin\fP(1). Tiene un tamaño fijo, y el índice apropiado en el archivo estaba determinado por \fBlogin\fP(1) usando la llamada \fBttyslot\fP() para hallar el número de la línea en \fI/etc/ttys\fP (contando desde 1). .SS "La semántica de ttyslot" Thus, the function \fBttyslot\fP() returns the index of the controlling terminal of the calling process in the file \fI/etc/ttys\fP, and that is (usually) the same as the index of the entry for the current user in the file \fI/etc/utmp\fP. BSD still has the \fI/etc/ttys\fP file, but System V\-like systems do not, and hence cannot refer to it. Thus, on such systems the documentation says that \fBttyslot\fP() returns the current user's index in the user accounting data base. .SH "VALOR DEVUELTO" If successful, this function returns the slot number. On error (e.g., if none of the file descriptors 0, 1, or 2 is associated with a terminal that occurs in this data base) it returns 0 on UNIX\ V6 and V7 and BSD\-like systems, but \-1 on System V\-like systems. .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 \fBttyslot\fP() T} Seguridad del hilo MT\-Unsafe .TE .sp 1 .SH VERSIONES El archivo utmp se encuentra en diversos lugares en distintos sistemas, por ejemplo: \fI/etc/utmp\fP, \fI/var/adm/utmp\fP, \fI/var/run/utmp\fP. .SH ESTÁNDARES None. .SH HISTORIAL SUSv1; marked as LEGACY in SUSv2; removed in POSIX.1\-2001. SUSv2 requires \-1 on error. .PP La implementación de glibc2 de esta función lee el archivo \fB_PATH_TTYS\fP, definido en \fI\fP como "/etc/ttys". Devuelve 0 en caso de error. Como los sistemas Linux no suelen tener "/etc/ttys", siempre devolverá 0. .PP On BSD\-like systems and Linux, the declaration of \fBttyslot\fP() is provided by \fI\fP. On System V\-like systems, the declaration is provided by \fI\fP. Since glibc 2.24, \fI\fP also provides the declaration with the following feature test macro definitions: .PP .in +4n .EX (_XOPEN_SOURCE >= 500 || (_XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED)) && ! (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) .EE .in .PP .\" .SH HISTORY .\" .BR ttyslot () .\" appeared in UNIX V7. Minix también tiene \fIfttyslot\fP(\fIfd\fP). .SH "VÉASE TAMBIÉN" \fBgetttyent\fP(3), \fBttyname\fP(3), \fButmp\fP(5) .PP .SH TRADUCCIÓN La traducción al español de esta página del manual fue creada por Jorge Rodriguez (A.K.A. Tiriel) y Marcos Fouces . .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 .