*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: getprotobyname | Section: 3 | Source: Digital UNIX | File: getprotobyname.3.gz
getprotobyname(3) Library Functions Manual getprotobyname(3) NAME getprotobyname, getprotobyname_r - Get a protocol entry by protocol name LIBRARY Standard C Library (libc.so, libc.a) SYNOPSIS #include <netdb.h> struct protoent *getprotobyname( const char *name); [Digital] The following obsolete function is supported in order to maintain backward compatibility with previous versions of the operating system. You should not use it in new designs. int getprotobyname_r( const char *name, struct protoent *proto, struct pro- toent_data *proto_data); STANDARDS Interfaces documented on this reference page conform to industry stan- dards as follows: getprotobyname(): XPG4-UNIX Refer to the standards(5) reference page for more information about in- dustry standards and associated tags. PARAMETERS Specifies the official protocol name or alias. [Digital] For getpro- tobyname_r(), points to the protoent structure. The netdb.h header file defines the protoent structure. [Digital] For getprotoby- name_r(), is data for the protocols database. The netdb.h header file defines the protoent_data structure. DESCRIPTION The getprotobyname() function returns a pointer to a structure of type protoent. Its members specify data in fields from a record line in ei- ther the local /etc/protocols file or the NIS network protocols data- base file. To determine which file or files to search, and in which or- der, the system uses the switches in the /etc/svc.conf file. The netdb.h header file defines the protoent structure. The getprotobyname() function searches the network protocols database file sequentially until a match with the name parameter occurs. The name parameter will specify either the official protocol name or an alias. When EOF (End-of-File) is reached without a match, an error value is returned by this function. When using the getprotobyname() function, use the endprotoent() func- tion to close the protocols file. NOTES The getprotobyname() function returns a pointer to thread-specific data. Subsequent calls to this or a related function from the same thread overwrite this data. [Digital] The getprotobyname_r() function is an obsolete reentrant version of the getprotobyname() function. It is supported in order to maintain backward compatibility with previous versions of the operating system and should not be used in new designs. Note that you must zero- fill the proto_data structure before its first access by either the setprotoent_r() or getprotobyname_r() function. RETURN VALUES Upon successful completion, the getprotobyname() function returns a pointer to a protoent structure. If it fails or reaches the end of the network protocols database file, it returns a null pointer. [Digital] Upon successful completion, the getprotobyname_r() function stores the protoent structure in the location pointed to by proto, and returns a value of 0 (zero). Upon failure, it returns a value of -1. ERRORS Current industry standards do not define error values for the getproto- byname() function. [Digital] If any of the following conditions occurs, the getprotoby- name_r() function sets errno to the corresponding value: The proto_data or proto parameter is invalid. The search failed. In addition, if the getprotobyname() or getprotobyname_r() function fail to open the file, it sets errno to indicate the cause of the fail- ure. FILES The DARPA Internet network protocols name database file. Each record in the file occupies a single line and has three fields: the official protocol name, the protocol number, and protocol aliases. The database service selection configuration file. RELATED INFORMATION Functions: getprotobynumber(3), getprotoent(3), setprotoent(3), endpro- toent(3). Files: protocols(4), svc.conf(4) Networks: nis_intro(7) Standards: standards(5) delim off getprotobyname(3)

Navigation Options