?? getprotoent.3n
字號:
.\" SCCSID: @(#)getprotoent.3n 8.2 1/29/91.TH getprotoent 3n.SH Namegetprotoent, getprotobynumber, getprotobyname, setprotoent, endprotoent \- get protocols entry.SH Syntax.nf.B #include <netdb.h>.PP.B struct protoent *getprotoent().PP.B struct protoent *getprotobyname(\fIname\fP).B char *\fIname\fP;.PP.B struct protoent *getprotobynumber(\fIproto\fP).B int \fIproto\fP;.PP.B void setprotoent(\fIstayopen\fP).B int \fIstayopen\fP;.PP.B void endprotoent().fi.SH Description.NXR "getprotoent subroutine".NXR "getprotobyname subroutine".NXR "getprotobyname subroutine".NXR "setprotoent subroutine".NXR "endprotoent subroutine".NXR "protocols file" "getting entry"The.PN getprotoent ,.PN getprotobyname ,and.PN getprotobynumbersubroutineseach return a pointer to an object with thefollowing structurecontaining the broken-outfields of a line in the .PN protocolsdatabase..EXstruct protoent { char *p_name; /* official name of protocol */ char **p_aliases; /* alias list */ long p_proto; /* protocol number */};.EE.PPThe members of this structure are:.TP \w'p_aliases'u+2np_nameThe official name of the protocol..TP \w'p_aliases'u+2np_aliasesA zero terminated list of alternate names for the protocol..TP \w'p_aliases'u+2np_protoThe protocol number..PPIf the.I stayopenflag on a .PN setprotoentsubroutine is NULL, theprotocols database is opened. Otherwise the.PN setprotoenthas the effect of rewinding the protocols database.The.PN endprotoentmay be called toclose the protocols databasewhen processing is complete..PPThe.PN getprotoentsubroutine simply reads the nextline while.PN getprotobynameand.PN getprotobynumbersearch until a matching.I nameor.I protonumber is found(or until EOF is encountered).The.PN getprotoentsubroutine keeps a pointer in the database, allowingsuccessive calls to be used to search the entire file..PPA call to.PN setprotoentmust be made before a.PN whileloop using.PN getprotoentin order to perform initialization and an.PN endprotoentmust be used after the loop. Both.PN getprotobynameand.PN getprotobynumbermake calls to.PN setprotoentand.PN endprotoent ..SH Restrictions.NXR "getprotoent subroutine" "restrictions"All informationis contained in a static areaso it must be copied if it isto be saved. Only the Internetprotocols are currently understood..PP.PPIf YP is running, .PN getprotoentdoes not return the entries in any particular order.See the .I Guide to the Yellow Pages Servicefor setup information..PPThe services database may also be distributed using the BIND/Hesiodnaming service. See the .I Guide to the BIND/Hesiod Servicefor more information..SH Return ValuesNull pointer(0) returned on EOF or error..SH Files.PN /etc/protocols.SH See Alsoprotocols(5), svc.conf(5).br.I Guide to the BIND/Hesiod Service.br.I Guide to the Yellow Pages Service
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -