Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

setprotoent_r(3) [osf1 man page]

setprotoent(3)						     Library Functions Manual						    setprotoent(3)

NAME
setprotoent, setprotoent_r - Open or rewind the protocols file LIBRARY
Standard C Library (libc.so, libc.a) SYNOPSIS
#include <netdb.h> void setprotoent( int stay_open); [Tru64 UNIX] The following function is supported in order to maintain backward compatibility with previous versions of the operating sys- tem. int setprotoent_r( int stay_open, struct protoent_data *proto_data); The following definition of the setprotoent() function does not conform to current standards and is supported only for backward compatibil- ity (see standards(5)): int setprotoent( int stay_open); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: setprotoent(): XNS4.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Indicates when to close the protocols file. Specifying a value of 0 (zero) causes the file to be closed after each call to the setpro- toent() function. Specifying a nonzero value allows the protocols file to remain open after each function. [Tru64 UNIX] For setpro- toent_r() only, this points at a structure where setprotoent_r() stores information about the protocols file. DESCRIPTION
The setprotoent() (set protocol entry) function opens either the local /etc/protocols file or the NIS distributed protocols file and sets the file marker to the beginning of the file. To determine which file or files to search, and in which order, the system uses the switches in the /etc/svc.conf file. NOTES
[Tru64 UNIX] The setprotoent_r() function is the reentrant version of the setprotoent() function. It is supported in order to maintain backward compatibility with previous versions of the operating system. Upon successful completion, the setprotoent_r() function returns a value of 0 (zero). Otherwise, it returns a value of -1. [Tru64 UNIX] Note that before calling the setprotoent_r() function for the first time, you must zero-fill the protoent_data structure. The netdb.h header file defines the protoent_data structure. RETURN VALUES
[Tru64 UNIX] Upon successful completion, the version of setprotoent() provided for backward compatibility returns a value of 1. Other- wise, it returns a value of 0 (zero). ERRORS
Current industry standards do not define error values for the setprotoent() function. [Tru64 UNIX] If any of the following conditions occurs, the setprotoent_r() function sets errno to the corresponding value: The proto_data parameter is invalid. In addition, the setprotoent(), backward compatible version of setprotoent(), and setprotoent_r() functions can fail to open the file. In this case, errno will be set to the failure. FILES
Contains the protocol names. The database service selection configuration file. RELATED INFORMATION
Functions: endprotoent(3), getprotobyname(3), getprotobynumber(3), getprotoent(3). Files: protocols(4), svc.conf(4). Networks: nis_intro(7). Standards: standards(5). delim off setprotoent(3)

Check Out this Related Man Page

getprotobynumber(3)					     Library Functions Manual					       getprotobynumber(3)

NAME
getprotobynumber, getprotobynumber_r - Get a protocol entry by number LIBRARY
Standard C Library (libc.so, libc.a) SYNOPSIS
#include <netdb.h> struct protoent *getprotobynumber( int num); [Tru64 UNIX] The following obsolete function is supported in order to maintain backward compatibility with previous versions of the oper- ating system. You should not use it in new designs. int getprotobynumber_r( int num, struct protoent *proto, struct pro- toent_data *proto_data); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: getprotobyname(): XNS4.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Specifies the protocol number. [Tru64 UNIX] For getprotobynumber_r() only, this points to the protoent structure. The netdb.h header file defines the protoent structure. [Tru64 UNIX] For getprotobynumber_r() only, this is data for the protocols database. The netdb.h header file defines the protoent_data structure. DESCRIPTION
The getprotobynumber() function returns a pointer to a structure of type protoent. Its members specify data in fields from a record line in either the local /etc/protocols file or NIS distributed network protocols database file. To determine which file or files to search, and in which order, the system uses the switches in the /etc/svc.conf file. The netdb.h header file defines the protoent structure. The getprotobynumber() function searches the network protocols database file sequentially until a match with the num parameter occurs. The num parameter must specify the official protocol number. When EOF (End-Of-File) is reached without a match, a null pointer is returned by this function. When using the getprotobynumber() function, use the endprotoent() function to close the protocols file. NOTES
The getprotobynumber() function returns a pointer to thread-specific data. Subsequent calls to this or a related function from the same thread overwrite this data. [Tru64 UNIX] The getprotobynumber_r() function is an obsolete reentrant version of the getprotobynumber() 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 getprotobynumber_r() functions. RETURN VALUES
Upon successful completion, the getprotobynumber() 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. [Tru64 UNIX] Upon successful completion, the getprotobynumber_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 getprotobynumber() function. [Tru64 UNIX] If any of the following conditions occurs, the getprotobynumber_r() function sets errno to the corresponding value: The proto_data or proto parameter is invalid. The search failed. In addition, if the getprotobynumber() or getprotobynumber_r() function fails to open the file, it sets errno to indicate the cause of the failure. 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: getprotobyname(3), getprotoent(3), setprotoent(3), endprotoent(3). Files: protocols(4), svc.conf(4). Networks: nis_intro(7). Standards: standards(5). delim off getprotobynumber(3)
Man Page