Penguin
Blame: getprotoent(3)
EditPageHistoryDiffInfoLikePages
Annotated edit history of getprotoent(3) version 1, including all changes. View license author blame.
Rev Author # Line
1 perry 1 GETPROTOENT
2 !!!GETPROTOENT
3 NAME
4 SYNOPSIS
5 DESCRIPTION
6 RETURN VALUE
7 FILES
8 CONFORMING TO
9 SEE ALSO
10 ----
11 !!NAME
12
13
14 getprotoent, getprotobyname, getprotobynumber, setprotoent, endprotoent - get protocol entry
15 !!SYNOPSIS
16
17
18 __#include
19 __''name''__);
20 struct protoent *getprotobynumber(int__ ''proto''__);
21 void setprotoent(int__ ''stayopen''__);
22 void endprotoent(void);
23 __
24 !!DESCRIPTION
25
26
27 The __getprotoent()__ function reads the next line from
28 the file ''/etc/protocols'' and returns a structure
29 ''protoent'' containing the broken out fields from the
30 line. The ''/etc/protocols'' file is opened if
31 necessary.
32
33
34 The __getprotobyname()__ function returns a
35 ''protoent'' structure for the line from
36 ''/etc/protocols'' that matches the protocol name
37 ''name''.
38
39
40 The __getprotobynumber()__ function returns a
41 ''protoent'' structure for the line that matches the
42 protocol number ''number''.
43
44
45 The __setprotoent()__ function opens and rewinds the
46 ''/etc/protocols'' file. If ''stayopen'' is true (1),
47 then the file will not be closed between calls to
48 __getprotobyname()__ or
49 __getprotobynumber()__.
50
51
52 The __endprotoent()__ function closes
53 ''/etc/protocols''.
54
55
56 The ''protoent'' structure is defined in
57 '''' as follows:
58
59
60 struct protoent {
61 char *p_name; /* official protocol name */
62 char **p_aliases; /* alias list */
63 int p_proto; /* protocol number */
64 }
65
66
67 The members of the ''protoent'' structure
68 are:
69
70
71 ''p_name''
72
73
74 The official name of the protocol.
75
76
77 ''p_aliases''
78
79
80 A zero terminated list of alternative names for the
81 protocol.
82
83
84 ''p_proto''
85
86
87 The protocol number.
88 !!RETURN VALUE
89
90
91 The __getprotoent()__, __getprotobyname()__ and
92 __getprotobynumber()__ functions return the
93 ''protoent'' structure, or a NULL pointer if an error
94 occurs or the end of the file is reached.
95 !!FILES
96
97
98 ''/etc/protocols''
99
100
101 protocol database file
102 !!CONFORMING TO
103
104
105 BSD 4.3
106 !!SEE ALSO
107
108
109 getservent(3), getnetent(3),
110 protocols(5)
111 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.