.\" -*- coding: UTF-8 -*- .\" Copyright (C) 2001 Andries Brouwer . .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\" 2007-07-05 mtk: Added details on underlying system call interfaces .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH UNAME 2 "10 Octubre 2019" Linux "Manual del Programador de Linux" .SH NOMBRE uname \- obtiene el nombre e información del núcleo actual .SH SINOPSIS \fB#include \fP .PP \fBint uname(struct utsname *\fP\fIbuf\fP\fB);\fP .SH DESCRIPCIÓN \fBuname\fP() devuelve información del sistema en la estructura apuntada por \fIbuf\fP. La estructura \fIutsname\fP se define en \fI\fP: .PP .in +4n .EX struct utsname { char sysname[]; /* Operating system name (e.g., "Linux") */ char nodename[]; /* Name within "some implementation\-defined network" */ char release[]; /* Operating system release (e.g., "2.6.28") */ char version[]; /* Operating system version */ char machine[]; /* Hardware identifier */ #ifdef _GNU_SOURCE char domainname[]; /* NIS or YP domain name */ #endif }; .EE .in .PP The length of the arrays in a \fIstruct utsname\fP is unspecified (see NOTES); the fields are terminated by a null byte (\(aq\e0\(aq). .SH "VALOR DEVUELTO" En caso de éxito se devuelve cero. En caso de error se devuelve \-1, y \fIerrno\fP se configura adecuadamente. .SH ERRORES .TP \fBEFAULT\fP \fIbuf\fP no es válido. .SH "CONFORME A" POSIX.1\-2001, POSIX.1\-2008, SVr4. No hay ninguna llamada \fBuname\fP() en 4.3BSD. .PP El miembro \fIdomainname\fP (el nombre de dominio NIS o YP) es una extensión de GNU. .SH NOTAS Esta es una llamada al sistema, y el sistema operativo conoce presumiblemente su nombre, revisión y versión. También sabe sobre qué hardware se ejecuta. Por tanto, cuatro de los campos de la estructura son relevantes. Por otra parte, el campo \fInodename\fP carece de importancia: da el nombre de la máquina actual en alguna red indefinida, pero normalmente las máquinas se encuentran en más de una red y tienen muchos nombres. Además, el núcleo no tiene manera de conocer estas situaciones, por lo que hay que decirle cómo actuar en este caso. Lo mismo vale para el campo adicional \fIdomainname\fP. .PP Para este propósito Linux utiliza las llamadas al sistema \fBsethostname\fP(2) y \fBsetdomainname\fP(2). Observe que no hay ningún estándar que diga que el nombre de host establecido por \fBsethostname\fP(2) sea la misma cadena que contiene el campo \fInodename\fP de la estructura devuelta por \fBuname\fP() (de hecho, algunos sistemas permiten un nombre de host de 256 bytes y un nodename de 8 bytes), pero ésto es cierto en Linux. Lo mismo vale para \fBsetdomainname\fP(2) y el campo \fIdomainname\fP. .PP La longitud de los campos en la estructura varía. Algunos sistemas operativos o bibliotecas usan valores fijos como 9, 33, 65 o 257. Otros sistemas usan \fBSYS_NMLN\fP o \fB_SYS_NMLN\fP o \fBUTSLEN\fP o \fB_UTSNAME_LENGTH\fP. Claramente, es una mala idea usar cualquiera de estas constantes \- tan sólo utilice sizeof(...). A menudo se elige 257 con el fin de tener espacio para un nombre de host en internet. .PP Parte de la información de utsname también puede ser accedida via \fI/proc/sys/kernel/\fP{\fIostype\fP, \fIhostname\fP, \fIosrelease\fP, \fIversion\fP, \fIdomainname\fP}. .SS "Diferencias kernel / biblioteca C" .\" That was back before Linux 1.0 .\" That was also back before Linux 1.0 Over time, increases in the size of the \fIutsname\fP structure have led to three successive versions of \fBuname\fP(): \fIsys_olduname\fP() (slot \fI__NR_oldolduname\fP), \fIsys_uname\fP() (slot \fI__NR_olduname\fP), and \fIsys_newuname\fP() (slot \fI__NR_uname)\fP. The first one used length 9 for all fields; the second used 65; the third also uses 65 but adds the \fIdomainname\fP field. The glibc \fBuname\fP() wrapper function hides these details from applications, invoking the most recent version of the system call provided by the kernel. .SH "VÉASE TAMBIÉN" \fBuname\fP(1), \fBgetdomainname\fP(2), \fBgethostname\fP(2), \fButs_namespaces\fP(7) .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 Urko Lusa y 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 .