.\" -*- coding: UTF-8 -*- .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) .\" .\" %%%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 .\" .\" References consulted: .\" Linux libc source code .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sat Jul 24 19:19:11 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified Wed Oct 18 20:23:54 1995 by Martin Schulze .\" Modified Mon Apr 22 01:50:54 1996 by Martin Schulze .\" 2001-07-25 added a clause about NULL proto (Martin Michlmayr or David N. Welton) .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH GETSERVENT 3 "21 Diciembre 2020" GNU "Manual del Programador de Linux" .SH NOMBRE getservent, getservbyname, getservbyport, setservent, endservent \- obtiene valores de servicios .SH SINOPSIS .nf \fB#include \fP .PP \fBstruct servent *getservent(void);\fP .PP \fBstruct servent *getservbyname(const char *\fP\fIname\fP\fB, const char *\fP\fIproto\fP\fB);\fP .PP \fBstruct servent *getservbyport(int \fP\fIport\fP\fB, const char *\fP\fIproto\fP\fB);\fP .PP \fBvoid setservent(int \fP\fIstayopen\fP\fB);\fP .PP \fBvoid endservent(void);\fP .fi .SH DESCRIPCIÓN La función \fBgetservent\fP() lee la siguiente línea de la base de datos de servicios (consulte \fBservices\fP(5)) y devuelve una estructura \fIservent\fP que contiene en sus campos los campos de la línea. Si es necesario, se abre una conexión a la base de datos .PP The \fBgetservbyname\fP() function returns a \fIservent\fP structure for the entry from the database that matches the service \fIname\fP using protocol \fIproto\fP. If \fIproto\fP is NULL, any protocol will be matched. A connection is opened to the database if necessary. .PP La función \fBgetservbyport\fP() devuelve una estructura de tipo \fIservent\fP con los datos de la línea que contiene el puerto \fIport\fP (con los bytes en el orden de red) y usa el protocolo \fIproto\fP. Si \fIproto\fP vale NULL, cualquier protocolo se dará como válido. Si necesarios, se abrirá una conexión con la base de datos. .PP La función \fBsetservent\fP() abre una conexión con la base de datos y define la siguiente entrada como la primera. Si \fIstayopen\fP es distinto de cero, entonces no se cerrará la conexión a la base de datos entre llamadas a las funciones \fBgetserv*\fP(). .PP La función \fBendservent\fP() cierra la conexión a la base de datos. .PP La estructura \fIservent\fP está definida en \fI\fP como sigue: .PP .in +4n .EX struct servent { char *s_name; /* nombre oficial del servicio */ char **s_aliases; /* lista de alias */ int s_port; /* número de puerto */ char *s_proto; /* protocolo a usar */ } .EE .in .PP Los miembros de la estructura \fIservent\fP son: .TP \fIs_name\fP El nombre oficial del servicio. .TP \fIs_aliases\fP Una lista terminada en NULL de nombres alternativos para el servicio. .TP \fIs_port\fP El numero de puerto para el servicio, con sus bytes en el orden de red. .TP \fIs_proto\fP El nombre del protoclo a usar con este servicio. .SH "VALOR DEVUELTO" Las funciones \fBgetservent\fP(), \fBgetservbyname\fP() y \fBgetservbyport\fP() devuelve una estructura de tipo \fIservent\fP, o un puntero NULL si ha ocurrido un error o se ha alcanzado el final del archivo. .SH ARCHIVOS .TP \fI/etc/services\fP Fichero de base de datos de servicios .SH ATRIBUTOS Para obtener una explicación de los términos usados en esta sección, véase \fBattributes\fP(7). .TS allbox; lbw15 lb lbw25 l l l. Interfaz Atributo Valor T{ \fBgetservent\fP() T} Seguridad del hilo T{ MT\-Unsafe race:servent .br race:serventbuf locale T} T{ \fBgetservbyname\fP() T} Seguridad del hilo T{ MT\-Unsafe race:servbyname .br locale T} T{ \fBgetservbyport\fP() T} Seguridad del hilo T{ MT\-Unsafe race:servbyport .br locale T} T{ \fBsetservent\fP(), .br \fBendservent\fP() T} Seguridad del hilo T{ MT\-Unsafe race:servent .br locale T} .TE .sp 1 In the above table, \fIservent\fP in \fIrace:servent\fP signifies that if any of the functions \fBsetservent\fP(), \fBgetservent\fP(), or \fBendservent\fP() are used in parallel in different threads of a program, then data races could occur. .SH "CONFORME A" POSIX.1\-2001, POSIX.1\-2008, 4.3BSD. .SH "VÉASE TAMBIÉN" \fBgetnetent\fP(3), \fBgetprotoent\fP(3), \fBgetservent_r\fP(3), \fBservices\fP(5) .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/. .PP .SH TRADUCCIÓN La traducción al español de esta página del manual fue creada por Miguel Pérez Ibars 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 .