.\" -*- 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 décembre 2020" GNU "Manuel du programmeur Linux" .SH NOM getservent, getservbyname, getservbyport, setservent, endservent \- Accéder aux informations sur les services .SH SYNOPSIS .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 DESCRIPTION La fonction \fBgetservent\fP() lit l'enregistrement suivant de la base de données de services (consultez \fBservices\fP(5)) et renvoie une structure \fIservent\fP contenant les champs de l'enregistrement. Une connexion est crée si nécessaire. .PP La fonction \fBgetservbyname\fP() renvoie une structure \fIservent\fP pour l'enregistrement du fichier \fI/etc/services\fP qui correspond au service nommé \fIname\fP et utilisant le protocole \fIproto\fP. Si \fIproto\fP est NULL, n'importe quel protocole sera accepté. .PP \fBgetservbyport\fP() renvoie une structure \fIservent\fP de l'enregistrement correspondant au port \fIport\fP indiqué (dans l'ordre des octets du réseau) et utilisant le protocole \fIproto\fP. Si \fIproto\fP est NULL, tout protocole sera accepté. Une connexion est créée si nécessaire. .PP \fBsetservent\fP() ouvre une connexion à la base et définit la prochaine entrée à la première entrée. Si \fIstayopen\fP est non nul, alors la connexion ne sera pas fermée entre deux appels aux fonctions \fBgetserv*\fP(). .PP \fBendservent\fP() ferme la connexion à la base. .PP La structure \fIservent\fP est définie dans \fI\fP ainsi\ : .PP .in +4n .EX struct servent { char *s_name; /* Nom officiel du service */ char **s_aliases; /* Liste d'alias */ int s_port; /* Numéro de port */ char *s_proto; /* Protocole à utiliser */ } .EE .in .PP Les membres de la structure \fIservent\fP sont\ : .TP \fIs_name\fP Le nom officiel du service. .TP \fIs_aliases\fP Une liste alias de noms de service terminée par NULL. .TP \fIs_port\fP Le numéro de port, donné dans l'ordre des octets du réseau. .TP \fIs_proto\fP Le nom du protocole utilisé par ce service. .SH "VALEUR RENVOYÉE" The \fBgetservent\fP(), \fBgetservbyname\fP(), and \fBgetservbyport\fP() functions return a pointer to a statically allocated \fIservent\fP structure, or NULL if an error occurs or the end of the file is reached. .SH FICHIERS .TP \fI/etc/services\fP Base de données des services. .SH ATTRIBUTS Pour une explication des termes utilisés dans cette section, consulter \fBattributes\fP(7). .TS allbox; lbw15 lb lbw25 l l l. Interface Attribut Valeur T{ \fBgetservent\fP() T} Sécurité des threads T{ MT\-Unsafe race:servent .br race:serventbuf locale T} T{ \fBgetservbyname\fP() T} Sécurité des threads T{ MT\-Unsafe race:servbyname .br locale T} T{ \fBgetservbyport\fP() T} Sécurité des threads T{ MT\-Unsafe race:servbyport .br locale T} T{ \fBsetservent\fP(), .br \fBendservent\fP() T} Sécurité des threads 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 CONFORMITÉ POSIX.1\-2001, POSIX.1\-2008, 4.3BSD. .SH "VOIR AUSSI" \fBgetnetent\fP(3), \fBgetprotoent\fP(3), \fBgetservent_r\fP(3), \fBservices\fP(5) .SH COLOPHON Cette page fait partie de la publication\ 5.10 du projet \fIman\-pages\fP Linux. Une description du projet et des instructions pour signaler des anomalies et la dernière version de cette page peuvent être trouvées à l'adresse \%https://www.kernel.org/doc/man\-pages/. .SH TRADUCTION La traduction française de cette page de manuel a été créée par Christophe Blaess , Stéphan Rafin , Thierry Vignaud , François Micaux, Alain Portal , Jean-Philippe Guérard , Jean-Luc Coulon (f5ibh) , Julien Cristau , Thomas Huriaux , Nicolas François , Florentin Duneau , Simon Paillard , Denis Barbier et David Prévot . Cette traduction est une documentation libre ; veuillez vous reporter à la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License version 3 .UE concernant les conditions de copie et de distribution. Il n'y a aucune RESPONSABILITÉ LÉGALE. Si vous découvrez un bogue dans la traduction de cette page de manuel, veuillez envoyer un message à .MT debian-l10n-french@lists.debian.org .ME .