File: getservent.3

package info (click to toggle)
manpages-fr 0.9.3-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 7,052 kB
  • ctags: 4
  • sloc: makefile: 58; sh: 8
file content (114 lines) | stat: -rw-r--r-- 4,180 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
.\"
.\" 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.
.\"
.\" 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 <joey@infodrom.north.de>
.\" Modified Mon Apr 22 01:50:54 1996 by Martin Schulze <joey@infodrom.north.de>
.\"
.\" Traduction 03/11/1996 par Christophe Blaess (ccb@club-internet.fr)
.\"
.TH GETSERVENT 3 "3 Novembre 1996" BSD "Manuel du programmeur Linux"
.SH NOM
getservent, getservbyname, getservbyport, setservent, endservent \- Accder aux informations sur les services.
.SH SYNOPSIS
.nf
.B #include <netdb.h>
.sp
.B struct servent *getservent (void);
.sp
.BI "struct servent *getservbyname (const char *" name ", const char *" proto );
.sp
.BI "struct servent *getservbyport (int " port ", const char *" proto );
.sp
.BI "void setservent (int " stayopen );
.sp
.B void endservent (void);
.fi
.SH DESCRIPTION
La fonction \fBgetservent()\fP lit l'enregistrement suivant du fichier
\fI/etc/services\fP et renvoie une structure \fIservent\fP contenant les
divers champs de l'enregistrement. Le fichier \fI/etc/services\fP est
ouvert si besoin est.
.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.
.PP
La fonction \fBgetservbyport()\fP renvoie une structure \fIservent\fP
pour l'enregistrement correspondant au \fIport\fP indiqu (dans l'ordre
des octets du rseau) et utilisant le protocole \fIproto\fP. 
.PP
La fonction \fBsetservent()\fP ouvre, et ramne au dbut le pointeur du
fichier \fI/etc/services\fP. Si \fIstayopen\fP est vrai (valant 1), alors 
le fichiers ne sera pas referm entre les appels successifs 
\fBgetservbyname()\fP et \fBgetservbyport()\fP.
.PP
la fonction \fBendservent()\fP ferme le fichier \fI/etc/services\fP.
.PP
La structure \fIservent\fP est dfinie dans \fI<netdb.h>\fP ainsi :
.sp
.RS
.nf
.ne 6
.ta 8n 16n 32n
struct servent {
  char  *s_name;    /* Nom officiel du service */
  char **s_aliases; /* Liste d'alias           */
  int    s_port;    /* Numro de port          */
  char  *s_proto;   /* Protocole utilis       */
}
.ta
.fi
.RE
.PP
Les membres de la structure \fIservent\fP sont :
.TP
.I s_name
Le nom officiel du service.
.TP
.I s_aliases
Une liste termine par zro contenant d'autres noms utilisables pour le service.
.TP
.I s_port
Le numro de port, donn dans l'ordre des octets du rseau.
.TP
.I s_proto
Le nom du protocole utilis par ce service.
.SH "VALEUR RENVOYE"
Les fonctions \fBgetservent()\fP, \fBgetservbyname()\fP et \fBgetservbyport()\fP
renvoient une structure \fIservent\fP, ou un pointeur NULL si une erreur se
produit, ou si la fin du fichier est atteinte.
.SH FICHIERS
.TP
.I /etc/services
Base de donnes des services.
.SH "CONFORMIT"
BSD 4.3
.SH "VOIR AUSSI"
.BR getprotoent "(3), " getnetent "(3), " services (5)

.SH TRADUCTION
Christophe Blaess, 1997.